Procházet zdrojové kódy

Merge remote-tracking branch 'origin/package' into package

Letianhua před 1 rokem
rodič
revize
683187b4fd

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <小程序监听修改上线> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <小程序监听修改上线2> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 10 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/task/PayApplicationTask.java

@@ -5,6 +5,7 @@ import com.zanxiang.game.module.manage.service.IAppletCheckService;
 import com.zanxiang.module.redis.service.IDistributedLockComponent;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -26,11 +27,20 @@ public class PayApplicationTask {
     @Autowired
     private IAppletCheckService appletCheckService;
 
+    /**
+     * 服务器域名
+     */
+    @Value("${taskRun}")
+    private Boolean taskRun;
+
     /**
      * 小程序每10分钟检查
      */
     @Scheduled(cron = "0 0/10 * * * ?")
     public void payApplicationCheck() {
+        if (!taskRun) {
+            return;
+        }
         //上锁
         if (!distributedLockComponent.doLock(RedisKeyConstant.PAY_APP_CHECK_LOCK, 0L, 15L, TimeUnit.MINUTES)) {
             return;