Added checks for non-user foreign keys in stores. Load/Saving stores' order is now based on table dependencies. Added ability to use chat message when using redemption.

This commit is contained in:
Tom
2025-01-28 19:12:14 +00:00
parent 6d955f245a
commit 3e717522c2
18 changed files with 146 additions and 102 deletions

View File

@ -1,4 +1,3 @@
using HermesSocketLibrary.db;
using HermesSocketLibrary.Requests.Messages;
using HermesSocketServer.Models;
using HermesSocketServer.Store;
@ -24,10 +23,10 @@ namespace HermesSocketServer.Services
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{
_logger.Information("Loading TTS voices...");
await _voices.Load();
_logger.Information("Loading users...");
await _users.Load();
_logger.Information("Loading TTS voices...");
await _voices.Load();
await Task.Run(async () =>
{
@ -35,11 +34,10 @@ namespace HermesSocketServer.Services
while (true)
{
await Task.WhenAll([
_voices.Save(),
_users.Save(),
_channels.Save(),
]);
await _users.Save();
await _voices.Save();
await _channels.Save();
await Task.Delay(TimeSpan.FromSeconds(_configuration.Database.SaveDelayInSeconds));
}
});