fix: Fixes order of execution with AutoSave and TZ (#1665)

This commit is contained in:
Kamron Batman 2024-01-24 17:17:45 -08:00 committed by GitHub
parent 3812a783ca
commit 64a8d6cb5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -20,12 +20,15 @@ namespace Server;
public static class TimeZoneHandler
{
public static TimeZoneInfo SystemTimeZone { get; private set; }
public static TimeZoneInfo SystemTimeZone { get; private set; } = TimeZoneInfo.Local;
public static void Configure()
{
var tzId = ServerConfiguration.GetSetting("system.localTimeZone", TimeZoneInfo.Local.Id);
SystemTimeZone = FindTimeZoneById(tzId);
if (tzId != SystemTimeZone.Id)
{
SystemTimeZone = FindTimeZoneById(tzId);
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]

View file

@ -35,9 +35,9 @@ namespace Server.Saves
public static void Configure()
{
SavesEnabled = ServerConfiguration.GetOrUpdateSetting("autosave.enabled", true);
Delay = ServerConfiguration.GetOrUpdateSetting("autosave.saveDelay", TimeSpan.FromMinutes(5.0));
Warning = ServerConfiguration.GetOrUpdateSetting("autosave.warningDelay", TimeSpan.Zero);
SavesEnabled = ServerConfiguration.GetOrUpdateSetting("autosave.enabled", true);
}
public static void ResetAutoSave(TimeSpan saveDelay, TimeSpan warningDelay)