diff --git a/Directory.Packages.props b/Directory.Packages.props index 7c00acfcec..d5ae562700 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -66,7 +66,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TUnit.Example.Asp.Net/Services/RedisCacheService.cs b/TUnit.Example.Asp.Net/Services/RedisCacheService.cs index 4feb2d6eda..55bfabc493 100644 --- a/TUnit.Example.Asp.Net/Services/RedisCacheService.cs +++ b/TUnit.Example.Asp.Net/Services/RedisCacheService.cs @@ -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"); }