mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-10-16 07:59:57 +00:00
Fix tickCount incrementing more than once per tick
This commit is contained in:
parent
41def830c4
commit
85bb07ed96
1 changed files with 1 additions and 1 deletions
|
@ -57,11 +57,11 @@ class ShardBackgroundWorker : IDisposable {
|
||||||
if (Instance.DiscordClient.ConnectionState != ConnectionState.Connected) continue;
|
if (Instance.DiscordClient.ConnectionState != ConnectionState.Connected) continue;
|
||||||
|
|
||||||
// Execute tasks sequentially
|
// Execute tasks sequentially
|
||||||
|
_tickCount++;
|
||||||
foreach (var service in _workers) {
|
foreach (var service in _workers) {
|
||||||
CurrentExecutingService = service.GetType().Name;
|
CurrentExecutingService = service.GetType().Name;
|
||||||
try {
|
try {
|
||||||
if (_workerCanceller.IsCancellationRequested) break;
|
if (_workerCanceller.IsCancellationRequested) break;
|
||||||
_tickCount++;
|
|
||||||
await service.OnTick(_tickCount, _workerCanceller.Token);
|
await service.OnTick(_tickCount, _workerCanceller.Token);
|
||||||
} catch (Exception ex) when (ex is not
|
} catch (Exception ex) when (ex is not
|
||||||
(TaskCanceledException or OperationCanceledException or ObjectDisposedException)) {
|
(TaskCanceledException or OperationCanceledException or ObjectDisposedException)) {
|
||||||
|
|
Loading…
Reference in a new issue