fix: if delay more than int set max of int

This commit is contained in:
2025-02-02 04:50:04 +03:00
parent 1687e9d89b
commit 7c7707b1e2

View File

@ -102,7 +102,7 @@ public class ScheduleSyncService : IHostedService, IDisposable
delay = 1; delay = 1;
_cancellationTokenSource = new CancellationTokenSource(); _cancellationTokenSource = new CancellationTokenSource();
_timer = new Timer(ExecuteTask, null, Math.Abs((long)delay), Timeout.Infinite); _timer = new Timer(ExecuteTask, null, delay > int.MaxValue ? int.MaxValue : (int)delay, Timeout.Infinite);
} }
private async void ExecuteTask(object? state) private async void ExecuteTask(object? state)