fix【【test轨迹中心】当前时间已经超过了定时任务开始时间,拉取状态未变更为拉取中】

https://www.tapd.cn/60863849/bugtrace/bugs/view/1160863849001049248
This commit is contained in:
xiaolipro 2024-09-20 16:52:01 +08:00
parent 2881f592e0
commit 39c0f8a6f7

View File

@ -23,6 +23,10 @@ public class OrderPullStatusScanner : BackgroundService
protected override async Task ExecuteAsync(CancellationToken stoppingToken) protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{ {
while (true)
{
await Task.Delay(TimeSpan.FromSeconds(_options.CurrentValue.OrderPullStatusScanInterval), stoppingToken);
var stopwatch = Stopwatch.StartNew(); var stopwatch = Stopwatch.StartNew();
var count1 = await _orderRepository.UpdatePullStatusBySilenceAsync(); var count1 = await _orderRepository.UpdatePullStatusBySilenceAsync();
// real del // real del
@ -30,7 +34,6 @@ public class OrderPullStatusScanner : BackgroundService
stopwatch.Stop(); stopwatch.Stop();
LogHelper.Info( LogHelper.Info(
$"{nameof(OrderPullStatusScanner)}本次扫描更新了{count1}条,删除了{count2}条订单拉取状态,耗时{stopwatch.ElapsedMilliseconds}ms"); $"{nameof(OrderPullStatusScanner)}本次扫描更新了{count1}条,删除了{count2}条订单拉取状态,耗时{stopwatch.ElapsedMilliseconds}ms");
}
await Task.Delay(TimeSpan.FromSeconds(_options.CurrentValue.OrderPullStatusScanInterval), stoppingToken);
} }
} }