about ExpiresAtTime ,I think it is a mistake

Oct 13, 2011 at 2:32 AM
Edited Oct 13, 2011 at 2:34 AM

class  Enyim.Caching.Memcached.StoreOperation :

private static long GetExpiration(TimeSpan validFor, DateTime expiresAt)
		{
			if (validFor >= TimeSpan.Zero && expiresAt > DateTime.MinValue)
				throw new ArgumentException("You cannot specify both validFor and expiresAt.");

			if (expiresAt > DateTime.MinValue)
			{
				if (expiresAt < UnixEpoch)
					throw new ArgumentOutOfRangeException("expiresAt", "expiresAt must be >= 1970/1/1");

				return (long)(expiresAt.ToUniversalTime() - UnixEpoch).TotalSeconds;
			}

			if (validFor.TotalSeconds >= MaxSeconds || validFor < TimeSpan.Zero)
				throw new ArgumentOutOfRangeException("validFor", "validFor must be < 30 days && >= 0");

			return (long)validFor.TotalSeconds;
		}

 the red word "UnixEpoch", is it should be "DateTime.Now" ?

this methed GetExpiration(TimeSpan validFor, DateTime expiresAt)

if TimeSpan validFor is valid, the methed returns the seconds from TimeSpan since now .

so , if expiresAt is valid, it need to return the seconds since now too.