|
@@ -7,8 +7,7 @@ import cn.seecoder.web.model.po.pipeline.DeploymentPO;
|
|
|
import cn.seecoder.web.model.po.pipeline.PipelinePO;
|
|
import cn.seecoder.web.model.po.pipeline.PipelinePO;
|
|
|
import cn.seecoder.web.service.pipeline.DeploymentService;
|
|
import cn.seecoder.web.service.pipeline.DeploymentService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import lombok.extern.log4j.Log4j;
|
|
|
|
|
-import lombok.extern.log4j.Log4j2;
|
|
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -16,7 +15,7 @@ import org.springframework.stereotype.Component;
|
|
|
import java.sql.Timestamp;
|
|
import java.sql.Timestamp;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
-@Log4j2
|
|
|
|
|
|
|
+@Slf4j
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
@Async
|
|
@Async
|
|
|
@Component
|
|
@Component
|
|
@@ -27,8 +26,9 @@ public class ScheduledTasks {
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 1 * * ?")
|
|
@Scheduled(cron = "0 0 1 * * ?")
|
|
|
public void purgeZombieDeployments() {
|
|
public void purgeZombieDeployments() {
|
|
|
- long ONE_DAY_MILLIS = 86400000L;
|
|
|
|
|
- Timestamp expireLimit = new Timestamp(System.currentTimeMillis() - ONE_DAY_MILLIS);
|
|
|
|
|
|
|
+// final long ONE_DAY_MILLIS = 86400000L;
|
|
|
|
|
+ final long HALF_DAY_MILLIS = 43200000L;
|
|
|
|
|
+ Timestamp expireLimit = new Timestamp(System.currentTimeMillis() - HALF_DAY_MILLIS);
|
|
|
List<DeploymentPO> deploymentPOList = deploymentMapper.selectAllDeployments();
|
|
List<DeploymentPO> deploymentPOList = deploymentMapper.selectAllDeployments();
|
|
|
for (DeploymentPO deploymentPO: deploymentPOList) {
|
|
for (DeploymentPO deploymentPO: deploymentPOList) {
|
|
|
Timestamp deployedTime = deploymentPO.getDeployedTime();
|
|
Timestamp deployedTime = deploymentPO.getDeployedTime();
|