소스 검색

提现ip限制

xiongzhu 3 년 전
부모
커밋
b4106fdea4
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/main/java/com/izouma/nineth/service/WithdrawApplyScheduleService.java

+ 5 - 0
src/main/java/com/izouma/nineth/service/WithdrawApplyScheduleService.java

@@ -1,6 +1,7 @@
 package com.izouma.nineth.service;
 
 import com.izouma.nineth.annotations.RedisLock;
+import com.izouma.nineth.config.GeneralProperties;
 import com.izouma.nineth.utils.DateTimeUtils;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -18,6 +19,7 @@ public class WithdrawApplyScheduleService {
 
     private SysConfigService     sysConfigService;
     private WithdrawApplyService withdrawApplyService;
+    private GeneralProperties    generalProperties;
 
 
     @Scheduled(cron = "0 0 8 * * ?")
@@ -31,6 +33,9 @@ public class WithdrawApplyScheduleService {
     @Scheduled(cron = "0 0 15 * * ?")
     @RedisLock(value = "'scheduleAutoApprove'", expire = 1, unit = TimeUnit.HOURS)
     public void scheduleAutoApprove() throws ExecutionException, InterruptedException {
+        if (generalProperties.getWorkerId() != 1) {
+            return;
+        }
         if (sysConfigService.getBoolean("enable_auto_withdraw")
                 && DateTimeUtils.isWorkDay(LocalDate.now())) {
             withdrawApplyService.approveAll();