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:
@ -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));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user