From 714eca49223a7eabdfc6666eb745c631d27046dc Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期三, 11 六月 2025 19:37:04 +0800 Subject: [PATCH] pref:锁日志 --- LifePayment/LifePayment.Worker/Worker/CheckUnPayOrderWork.cs | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/LifePayment/LifePayment.Worker/Worker/CheckUnPayOrderWork.cs b/LifePayment/LifePayment.Worker/Worker/CheckUnPayOrderWork.cs index 5bd2dec..0de3470 100644 --- a/LifePayment/LifePayment.Worker/Worker/CheckUnPayOrderWork.cs +++ b/LifePayment/LifePayment.Worker/Worker/CheckUnPayOrderWork.cs @@ -26,6 +26,7 @@ { private readonly int _doWorkHour = 0; private readonly int _doWorkMinute = 1; + private readonly ILogger<CheckUnPayOrderWork> logger; private readonly ILifePayOrderService lifePayOrderService; private readonly ILifePayService lifePayService; private readonly IAbpDistributedLock distributedLock; @@ -33,6 +34,7 @@ public CheckUnPayOrderWork( AbpAsyncTimer timer, + ILogger<CheckUnPayOrderWork> logger, IServiceScopeFactory serviceScopeFactory, ILifePayOrderService lifePayOrderService, ILifePayService lifePayService, @@ -40,6 +42,7 @@ IRepository<LifePayOrder, Guid> lifePayOrderRepository) : base(timer, serviceScopeFactory) { timer.Period = (int)TimeSpan.FromSeconds(5).TotalMilliseconds; + this.logger = logger; this.lifePayOrderService = lifePayOrderService; this.lifePayService = lifePayService; this.distributedLock = distributedLock; @@ -58,6 +61,7 @@ foreach (var order in orders) { await using var orderLock = await distributedLock.TryAcquireAsync($"LockKey:UpdateOrder:{order.OrderNo}", TimeSpan.FromSeconds(60)); + logger.LogInformation($"閿侊細LockKey:UpdateOrder:{order.OrderNo} - {orderLock != null}"); Logger.LogInformation($"璁㈠崟锛歿order.OrderNo}-{order.ToJson()}"); var wxPayNotice = await lifePayService.WxPayTradeQuery(order.OrderNo); -- Gitblit v1.9.1