Further async changes (#387)
* Further async changes - SaveServer & Backup Server are now async - Anything that ties in with SaveServer saving (Such as callbacks) are now async - Various async util methods added - Removed two wrapper methods and switched code over to use the actual method * Update test
This commit is contained in:
@@ -20,19 +20,19 @@ public class SaveCallbacks(
|
||||
public async Task OnLoad()
|
||||
{
|
||||
_backupService.StartBackupSystem();
|
||||
_saveServer.Load();
|
||||
await _saveServer.LoadAsync();
|
||||
}
|
||||
|
||||
public Task<bool> OnUpdate(long secondsSinceLastRun)
|
||||
public async Task<bool> OnUpdate(long secondsSinceLastRun)
|
||||
{
|
||||
if (secondsSinceLastRun < _coreConfig.ProfileSaveIntervalInSeconds)
|
||||
{
|
||||
// Not enough time has passed since last run, exit early
|
||||
return Task.FromResult(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
_saveServer.Save();
|
||||
await _saveServer.SaveAsync();
|
||||
|
||||
return Task.FromResult(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user