From 7c7707b1e28c8422c0a7e728b5ea1f2b3ba57766 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Sun, 2 Feb 2025 04:50:04 +0300 Subject: [PATCH] fix: if delay more than int set max of int --- .../Configuration/Core/BackgroundTasks/ScheduleSyncService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Endpoint/Configuration/Core/BackgroundTasks/ScheduleSyncService.cs b/Endpoint/Configuration/Core/BackgroundTasks/ScheduleSyncService.cs index 5ed3575..92dcadb 100644 --- a/Endpoint/Configuration/Core/BackgroundTasks/ScheduleSyncService.cs +++ b/Endpoint/Configuration/Core/BackgroundTasks/ScheduleSyncService.cs @@ -102,7 +102,7 @@ public class ScheduleSyncService : IHostedService, IDisposable delay = 1; _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)