Junjie
2 天以前 63b01db83d9aad8a15276b4236a9a22e4aeef065
src/main/java/com/zy/core/trace/StationTaskTraceRegistry.java
@@ -11,6 +11,7 @@
import com.zy.core.model.command.StationCommand;
import com.zy.core.enums.RedisKeyType;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -22,6 +23,7 @@
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
@Slf4j
@Component
public class StationTaskTraceRegistry {
@@ -302,7 +304,13 @@
            if (loadedFromRedis) {
                return;
            }
            long redisStartNs = System.nanoTime();
            Map<Object, Object> cacheMap = redisUtil == null ? null : redisUtil.hmget(TRACE_CACHE_KEY);
            long redisCostMs = (System.nanoTime() - redisStartNs) / 1_000_000L;
            if (redisCostMs > 100) {
                log.info("StationTaskTraceRegistry Redis加载耗时={}ms, entries={}", redisCostMs,
                        cacheMap == null ? 0 : cacheMap.size());
            }
            if (cacheMap != null && !cacheMap.isEmpty()) {
                long now = System.currentTimeMillis();
                for (Map.Entry<Object, Object> entry : cacheMap.entrySet()) {