Skip to content

Commit 83cc442

Browse files
committed
Change computing expiration to work with memcached 1.4
1 parent 4e74475 commit 83cc442

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Enyim.Caching/MemcachedClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,11 @@ protected static uint GetExpiration(
11611161
// infinity
11621162
if (validFor == TimeSpan.Zero || validFor == TimeSpan.MaxValue) return 0;
11631163

1164+
if (validFor.Value.TotalSeconds <= MaxSeconds)
1165+
{
1166+
return (uint)validFor.Value.TotalSeconds;
1167+
}
1168+
11641169
expiresAt = DateTime.Now.Add(validFor.Value);
11651170
}
11661171

0 commit comments

Comments
 (0)