Updated Services\Impl files

This commit is contained in:
Toastie 2024-06-28 15:16:12 +12:00
parent df56c76a89
commit eab5344c61
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
2 changed files with 8 additions and 0 deletions

View file

@ -191,6 +191,12 @@ public sealed class BotCredsProvider : IBotCredsProvider
creds.Version = 7; creds.Version = 7;
File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds)); 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));
}
} }
} }

View file

@ -3,6 +3,7 @@ using OneOf.Types;
using StackExchange.Redis; using StackExchange.Redis;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using YamlDotNet.Core.Tokens;
namespace EllieBot.Common; namespace EllieBot.Common;
@ -47,6 +48,7 @@ public sealed class RedisBotCache : IBotCache
var success = await db.StringSetAsync(key.Key, var success = await db.StringSetAsync(key.Key,
val, val,
expiry: expiry, expiry: expiry,
keepTtl: true,
when: overwrite ? When.Always : When.NotExists); when: overwrite ? When.Always : When.NotExists);
return success; return success;