Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<PackageVersion Include="PublicApiGenerator" Version="11.5.4" />
<PackageVersion Include="RandomDataGenerator.Net" Version="1.0.19.1" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.37" />
<PackageVersion Include="StackExchange.Redis" Version="2.10.1" />
<PackageVersion Include="Sourcy.DotNet" Version="1.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 2 additions & 1 deletion TUnit.Example.Asp.Net/Services/RedisCacheService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public async Task SetAsync(string key, string value, TimeSpan? expiry = null)
_logger.LogDebug("Setting cache key {Key}", prefixedKey);

var db = await GetDatabaseAsync();
await db.StringSetAsync(prefixedKey, value, expiry);
var expiration = expiry.HasValue ? expiry.Value : Expiration.Default;
await db.StringSetAsync(prefixedKey, value, expiration);

_logger.LogInformation("Cached value for key {Key}, expiry={Expiry}", prefixedKey, expiry?.ToString() ?? "none");
}
Expand Down
Loading