Skip to content

Commit

Permalink
Delay scheduled syncs when resuming from suspend.
Browse files Browse the repository at this point in the history
  • Loading branch information
phw198 committed Apr 27, 2024
1 parent 515a01a commit 8256c40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/OutlookGoogleCalendarSync/TimezoneDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ private TimezoneDB() {
private static void SystemEvents_TimeChanged(object sender, EventArgs e) {
log.Info("Detected system timezone change.");
System.Globalization.CultureInfo.CurrentCulture.ClearCachedData();

foreach(SettingsStore.Calendar profile in Settings.Instance.Calendars) {
if (profile.OgcsTimer.Enabled && profile.OgcsTimer.NextSyncDate < DateTime.Now.AddMinutes(1)) {
profile.OgcsTimer.SetNextSync(1, true, false);
}
}
}

public void CheckForUpdate() {
Expand Down

0 comments on commit 8256c40

Please sign in to comment.