Explorar o código

测试定时任务同时执行

dsx %!s(int64=2) %!d(string=hai) anos
pai
achega
08a55a23cf
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      src/main/java/com/fdkankan/scene/schedule/ScheduleJob.java

+ 10 - 0
src/main/java/com/fdkankan/scene/schedule/ScheduleJob.java

@@ -89,6 +89,11 @@ public class ScheduleJob {
     @Scheduled(cron="0 0 1 * * ?")
     public void cleanOss4DeletedSceneV3() {
         log.info("删除已删除V3场景原始资源开始");
+        try {
+            Thread.sleep(60000L);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
         String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_DELETED_ORIG_V3;
         try {
             boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
@@ -111,6 +116,11 @@ public class ScheduleJob {
     @Scheduled(cron="0 0 1 * * ?")
     public void cleanOss4DeletedSceneV4() {
         log.info("删除已删除V4场景原始资源开始");
+        try {
+            Thread.sleep(60000L);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
         String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_DELETED_ORIG_V4;
         try {
             boolean lock = redisLockUtil.lock(lockKey, 24*60*60);