From 85bb07ed96abc7a6071ff5e3e6706a01d7cfb923 Mon Sep 17 00:00:00 2001 From: Noi Date: Fri, 8 Dec 2023 20:45:40 -0800 Subject: [PATCH] Fix tickCount incrementing more than once per tick --- BackgroundServices/ShardBackgroundWorker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BackgroundServices/ShardBackgroundWorker.cs b/BackgroundServices/ShardBackgroundWorker.cs index 2c6f2f9..baeb4aa 100644 --- a/BackgroundServices/ShardBackgroundWorker.cs +++ b/BackgroundServices/ShardBackgroundWorker.cs @@ -57,11 +57,11 @@ class ShardBackgroundWorker : IDisposable { if (Instance.DiscordClient.ConnectionState != ConnectionState.Connected) continue; // Execute tasks sequentially + _tickCount++; foreach (var service in _workers) { CurrentExecutingService = service.GetType().Name; try { if (_workerCanceller.IsCancellationRequested) break; - _tickCount++; await service.OnTick(_tickCount, _workerCanceller.Token); } catch (Exception ex) when (ex is not (TaskCanceledException or OperationCanceledException or ObjectDisposedException)) {