Changed to cast double to long (#13935)
This commit is contained in:
@@ -111,7 +111,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;
|
||||
@@ -151,7 +151,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user