Skip to content

Commit

Permalink
Update sliding expire in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Jul 6, 2023
1 parent c4d13ca commit 414904b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EmployeePaycheck/Services/CacheData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class CacheData

public static void AddToCache(string key, IDistributedCache cache, CacheData cacheData)
{
var cacheExpirationInDays = 1;
var cacheExpirationInHours = 1;
var options = new DistributedCacheEntryOptions()
.SetSlidingExpiration(TimeSpan.FromDays(cacheExpirationInDays));
.SetSlidingExpiration(TimeSpan.FromHours(cacheExpirationInHours));
cache.SetString(key, System.Text.Json.JsonSerializer.Serialize(cacheData), options);
}

Expand Down

0 comments on commit 414904b

Please sign in to comment.