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