refactor: remove unnecessary while loop in Worker.Execute
This commit is contained in:
parent
f611e74de1
commit
0a175b9e9d
@ -18,14 +18,11 @@ namespace EnvelopeGenerator.Finalizer
|
||||
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
while (!context.CancellationToken.IsCancellationRequested)
|
||||
if (_logger.IsEnabled(LogLevel.Information))
|
||||
{
|
||||
if (_logger.IsEnabled(LogLevel.Information))
|
||||
{
|
||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||
}
|
||||
await Task.Delay(_options.IntervalInMillisecond, context.CancellationToken);
|
||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
||||
}
|
||||
await Task.Delay(_options.IntervalInMillisecond, context.CancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user