mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 18:20:11 +00:00
fix(bot): expose errors from the per-minute scheduled task
This commit is contained in:
parent
1f11dbf269
commit
f14c421e23
1 changed files with 9 additions and 2 deletions
|
|
@ -83,9 +83,16 @@ public class Bot
|
||||||
// This *probably* doesn't matter in practice but I jut think it's neat, y'know.
|
// This *probably* doesn't matter in practice but I jut think it's neat, y'know.
|
||||||
var timeNow = SystemClock.Instance.GetCurrentInstant();
|
var timeNow = SystemClock.Instance.GetCurrentInstant();
|
||||||
var timeTillNextWholeMinute = TimeSpan.FromMilliseconds(60000 - timeNow.ToUnixTimeMilliseconds() % 60000 + 250);
|
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));
|
}, null, timeTillNextWholeMinute, TimeSpan.FromMinutes(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue