From c97c04770c17c36c554963bf8bb8d8fafc6a8d43 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 07 五月 2026 09:43:35 +0800
Subject: [PATCH] #地图更新刷新缓存

---
 src/main/java/com/zy/core/task/MainProcessAsyncTaskScheduler.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/core/task/MainProcessAsyncTaskScheduler.java b/src/main/java/com/zy/core/task/MainProcessAsyncTaskScheduler.java
index dd7cfd5..a644995 100644
--- a/src/main/java/com/zy/core/task/MainProcessAsyncTaskScheduler.java
+++ b/src/main/java/com/zy/core/task/MainProcessAsyncTaskScheduler.java
@@ -46,6 +46,7 @@
                 return false;
             }
             taskGuard.lastSubmitTimeMs = now;
+            taskGuard.lastQueueEnterTimeMs = now;
         }
 
         try {
@@ -64,6 +65,7 @@
                              TaskGuard taskGuard,
                              Runnable task) {
         long startMs = System.currentTimeMillis();
+        long queueWaitMs = taskGuard.lastQueueEnterTimeMs > 0L ? startMs - taskGuard.lastQueueEnterTimeMs : 0L;
         try {
             task.run();
         } catch (Exception e) {
@@ -71,7 +73,7 @@
         } finally {
             long costMs = System.currentTimeMillis() - startMs;
             if (slowLogThresholdMs > 0L && costMs > slowLogThresholdMs) {
-                log.warn("MainProcess async task executed slowly, lane={}, task={}, cost={}ms", laneName, taskName, costMs);
+                log.warn("MainProcess async task executed slowly, lane={}, task={}, cost={}ms, queueWaitMs={}ms", laneName, taskName, costMs, queueWaitMs);
             }
             taskGuard.running.set(false);
         }
@@ -137,6 +139,7 @@
 
         private final AtomicBoolean running = new AtomicBoolean(false);
         private volatile long lastSubmitTimeMs = 0L;
+        private volatile long lastQueueEnterTimeMs = 0L;
     }
 
     private static class NamedThreadFactory implements ThreadFactory {

--
Gitblit v1.9.1