diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index c1dbb718..6b6d8107 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -83,9 +83,16 @@ public class Bot // This *probably* doesn't matter in practice but I jut think it's neat, y'know. var timeNow = SystemClock.Instance.GetCurrentInstant(); var timeTillNextWholeMinute = TimeSpan.FromMilliseconds(60000 - timeNow.ToUnixTimeMilliseconds() % 60000 + 250); - _periodicTask = new Timer(_ => + _periodicTask = new Timer(async _ => { - var __ = UpdatePeriodic(); + try + { + await UpdatePeriodic(); + } + catch (Exception e) + { + _logger.Error(e, "failed to run once-per-minute scheduled task"); + } }, null, timeTillNextWholeMinute, TimeSpan.FromMinutes(1)); }