【fix sonar】 JobLogReportHelper.java文件
This commit is contained in:
+3
-8
@@ -28,10 +28,7 @@ public class JobLogReportHelper {
|
||||
private Thread logrThread;
|
||||
private volatile boolean toStop = false;
|
||||
public void start(){
|
||||
logrThread = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
logrThread = new Thread(()-> {
|
||||
|
||||
// last clean log time
|
||||
long lastCleanLogTime = 0;
|
||||
@@ -110,10 +107,10 @@ public class JobLogReportHelper {
|
||||
List<Long> logIds = null;
|
||||
do {
|
||||
logIds = XxlJobAdminConfig.getAdminConfig().getXxlJobLogDao().findClearLogIds(0, 0, clearBeforeTime, 0, 1000);
|
||||
if (logIds!=null && logIds.size()>0) {
|
||||
if (logIds!=null && !logIds.isEmpty()) {
|
||||
XxlJobAdminConfig.getAdminConfig().getXxlJobLogDao().clearLog(logIds);
|
||||
}
|
||||
} while (logIds!=null && logIds.size()>0);
|
||||
} while (logIds!=null && !logIds.isEmpty());
|
||||
|
||||
// update clean time
|
||||
lastCleanLogTime = System.currentTimeMillis();
|
||||
@@ -130,8 +127,6 @@ public class JobLogReportHelper {
|
||||
}
|
||||
|
||||
logger.info(">>>>>>>>>>> xxl-job, job log report thread stop");
|
||||
|
||||
}
|
||||
});
|
||||
logrThread.setDaemon(true);
|
||||
logrThread.setName("xxl-job, admin JobLogReportHelper");
|
||||
|
||||
Reference in New Issue
Block a user