diff --git a/server/C#/HoneyBox/.gitignore b/server/C#/HoneyBox/.gitignore index 92f077b9..eae51249 100644 --- a/server/C#/HoneyBox/.gitignore +++ b/server/C#/HoneyBox/.gitignore @@ -82,3 +82,4 @@ logs/ secrets.json *.pfx *.p12 +.vs/* \ No newline at end of file diff --git a/server/C#/HoneyBox/src/HoneyBox.Api/HoneyBox.Api.csproj b/server/C#/HoneyBox/src/HoneyBox.Api/HoneyBox.Api.csproj index 9d55da0f..2d5f90e1 100644 --- a/server/C#/HoneyBox/src/HoneyBox.Api/HoneyBox.Api.csproj +++ b/server/C#/HoneyBox/src/HoneyBox.Api/HoneyBox.Api.csproj @@ -16,7 +16,7 @@ - + diff --git a/server/C#/HoneyBox/src/HoneyBox.Core/HoneyBox.Core.csproj b/server/C#/HoneyBox/src/HoneyBox.Core/HoneyBox.Core.csproj index 897161e2..45101796 100644 --- a/server/C#/HoneyBox/src/HoneyBox.Core/HoneyBox.Core.csproj +++ b/server/C#/HoneyBox/src/HoneyBox.Core/HoneyBox.Core.csproj @@ -7,7 +7,8 @@ - + + diff --git a/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisCacheService.cs b/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisCacheService.cs index 745ed584..de3350ae 100644 --- a/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisCacheService.cs +++ b/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisCacheService.cs @@ -1,4 +1,4 @@ -using System.Text.Json; +using System.Text.Json; using Microsoft.Extensions.Configuration; using StackExchange.Redis; @@ -52,7 +52,7 @@ public class RedisCacheService : ICacheService, IDisposable return; var json = JsonSerializer.Serialize(value); - await _database.StringSetAsync(key, json, expiry); + await _database.StringSetAsync(key, json, expiry,When.Always); } public async Task RemoveAsync(string key) diff --git a/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisService.cs b/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisService.cs index 9d605a61..e25fc7e5 100644 --- a/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisService.cs +++ b/server/C#/HoneyBox/src/HoneyBox.Infrastructure/Cache/RedisService.cs @@ -1,5 +1,7 @@ -using HoneyBox.Core.Interfaces; +using HoneyBox.Core.Interfaces; + using Microsoft.Extensions.Configuration; + using StackExchange.Redis; namespace HoneyBox.Infrastructure.Cache; @@ -16,13 +18,13 @@ public class RedisService : IRedisService, IDisposable public RedisService(IConfiguration configuration) { var connectionString = configuration.GetConnectionString("Redis") ?? "localhost:6379"; - + try { var options = ConfigurationOptions.Parse(connectionString); options.AbortOnConnectFail = false; options.ConnectTimeout = 5000; - + _connection = ConnectionMultiplexer.Connect(options); _database = _connection.GetDatabase(); _isConnected = _connection.IsConnected; @@ -47,7 +49,7 @@ public class RedisService : IRedisService, IDisposable if (_database == null || !_isConnected) return; - await _database.StringSetAsync(key, value, expiry); + await _database.StringSetAsync(key, value, expiry, When.Always); } public async Task DeleteAsync(string key) diff --git a/server/C#/HoneyBox/src/HoneyBox.Infrastructure/HoneyBox.Infrastructure.csproj b/server/C#/HoneyBox/src/HoneyBox.Infrastructure/HoneyBox.Infrastructure.csproj index ee244d44..b313268c 100644 --- a/server/C#/HoneyBox/src/HoneyBox.Infrastructure/HoneyBox.Infrastructure.csproj +++ b/server/C#/HoneyBox/src/HoneyBox.Infrastructure/HoneyBox.Infrastructure.csproj @@ -14,7 +14,8 @@ - + + diff --git a/server/C#/HoneyBox/src/HoneyBox.Model/HoneyBox.Model.csproj b/server/C#/HoneyBox/src/HoneyBox.Model/HoneyBox.Model.csproj index 51f943ff..b6b34080 100644 --- a/server/C#/HoneyBox/src/HoneyBox.Model/HoneyBox.Model.csproj +++ b/server/C#/HoneyBox/src/HoneyBox.Model/HoneyBox.Model.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable enable true @@ -16,6 +16,7 @@ all +