소스 검색

fix bug:更改定时任务

lijie 3 년 전
부모
커밋
a9d97a44c9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/BackMainThread.kt

+ 2 - 1
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/BackMainThread.kt

@@ -4,6 +4,7 @@ import cn.sagacloud.server.algorithm.backstage.state.*
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.scheduling.annotation.EnableScheduling
+import org.springframework.scheduling.annotation.Scheduled
 import org.springframework.stereotype.Component
 
 /**
@@ -53,7 +54,7 @@ class BackMainThread {
      * 定时任务, 处理它们的状态, 当前未完成时, 不会执行下一个scheduled
      */
     //@Scheduled(cron = "0 0/1 * * * ?")
-    //@Scheduled(fixedRate = 1000 * 60 * 3, initialDelay = 1000)
+    @Scheduled(fixedRate = 1000 * 60 * 3, initialDelay = 1000)
     fun run() {
         if(states.isEmpty()) {
 //            states.addAll(arrayListOf(state31, state3))