From 66c786a42d90934ca80ccbc00b0e50c40408fa1e Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 9 Mar 2023 15:54:29 +0000 Subject: [PATCH] Changed to cast double to long (#13935) (cherry picked from commit ca515c3ed757da7db9f6407f045b034f16f30955) --- .../HostedServices/RecurringHostedServiceBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs b/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs index 68b311f8cd..dc81b2d3e1 100644 --- a/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs +++ b/src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs @@ -118,7 +118,7 @@ public abstract class RecurringHostedServiceBase : IHostedService, IDisposable { using (!ExecutionContext.IsFlowSuppressed() ? (IDisposable)ExecutionContext.SuppressFlow() : null) { - _timer = new Timer(ExecuteAsync, null, (int)_delay.TotalMilliseconds, (int)_period.TotalMilliseconds); + _timer = new Timer(ExecuteAsync, null, _delay, _period); } return Task.CompletedTask; @@ -158,7 +158,7 @@ public abstract class RecurringHostedServiceBase : IHostedService, IDisposable { // Resume now that the task is complete - Note we use period in both because we don't want to execute again after the delay. // So first execution is after _delay, and the we wait _period between each - _timer?.Change((int)_period.TotalMilliseconds, (int)_period.TotalMilliseconds); + _timer?.Change(_period, _period); } }