diff --git a/src/EllieBot/Services/Impl/BotCredsProvider.cs b/src/EllieBot/Services/Impl/BotCredsProvider.cs index 3d2638e..5d2b480 100644 --- a/src/EllieBot/Services/Impl/BotCredsProvider.cs +++ b/src/EllieBot/Services/Impl/BotCredsProvider.cs @@ -191,6 +191,12 @@ public sealed class BotCredsProvider : IBotCredsProvider creds.Version = 7; File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds)); } + + if (creds.Version <= 7) + { + creds.Version = 8; + File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds)); + } } } diff --git a/src/EllieBot/Services/Impl/RedisBotCache.cs b/src/EllieBot/Services/Impl/RedisBotCache.cs index fffc727..259b820 100644 --- a/src/EllieBot/Services/Impl/RedisBotCache.cs +++ b/src/EllieBot/Services/Impl/RedisBotCache.cs @@ -3,6 +3,7 @@ using OneOf.Types; using StackExchange.Redis; using System.Text.Json; using System.Text.Json.Serialization; +using YamlDotNet.Core.Tokens; namespace EllieBot.Common; @@ -47,6 +48,7 @@ public sealed class RedisBotCache : IBotCache var success = await db.StringSetAsync(key.Key, val, expiry: expiry, + keepTtl: true, when: overwrite ? When.Always : When.NotExists); return success;