wanggaokun 1 år sedan
förälder
incheckning
16d083b900

+ 4 - 0
pdaaphm-admin/src/main/java/com/pdaaphm/biz/service/impl/RedisLogService.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
 import com.pdaaphm.biz.service.IRedisLogService;
 import com.pdaaphm.common.core.redis.RedisCache;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -25,6 +26,9 @@ public class RedisLogService implements IRedisLogService {
     @Override
     public String getLogInfo(String taskId) {
         List<String> logs = redisCache.getCacheList(taskId);
+        if(CollectionUtils.isEmpty(logs)) {
+            return "";
+        }
         String logStr = logs.get(0);
         log.info("GET::{}", logStr);
         logs.remove(0);