We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e217f1 commit 4842a99Copy full SHA for 4842a99
src/BootstrapBlazor.Server/Extensions/ICacheEntryExtensions.cs
@@ -47,6 +47,16 @@ public static string GetExpiration(this ICacheEntry entry)
47
private static TimeSpan GetSlidingLeftTime(this ICacheEntry entry)
48
{
49
var lastAccessed = entry.GetLastAccessed();
50
- return lastAccessed == null ? TimeSpan.Zero : entry.SlidingExpiration!.Value - (DateTime.UtcNow - lastAccessed.Value);
+ if (lastAccessed == null)
51
+ {
52
+ return TimeSpan.Zero;
53
+ }
54
+
55
+ var ts = entry.SlidingExpiration!.Value - (DateTime.UtcNow - lastAccessed.Value);
56
+ if (ts < TimeSpan.Zero)
57
58
+ ts = TimeSpan.Zero;
59
60
+ return ts;
61
}
62
0 commit comments