*
L
2026-04-22 18e03c72291dfcb9cebc3a21ab276bec4a0b262e
src/main/java/com/zy/core/ServerBootstrap.java
@@ -14,8 +14,8 @@
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -132,36 +132,36 @@
    public void destroy() {
    }
    @Component
    class licenseVerifyThread {
        @Scheduled(cron = "0 0 4 * * ?")
        public void licenseVerify() {
            int licenseVerifySignCount = 0;
            boolean licenseVerifySign = false;
            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
            if (!new LicenseVerify().verify()){
                for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
                    try{
                        Thread.sleep(1000);
                    }catch (Exception e){
                    }
                    if (!new LicenseVerify().verify()){
                        log.info("++++++++ 验证许可证失败 ++++++++");
                    } else {
                        log.info("++++++++ 验证许可证成功 ++++++++");
                        licenseVerifySign = true;
                    }
                }
                if (licenseVerifySignCount>10 && !licenseVerifySign){
                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
                } else {
                    if (systemSign){
                        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
                    }
                }
            }
        }
    }
//    @Component
//    class licenseVerifyThread {
//
//        @Scheduled(cron = "0 0 4 * * ?")
//        public void licenseVerify() {
//            int licenseVerifySignCount = 0;
//            boolean licenseVerifySign = false;
//            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
//            if (!new LicenseVerify().verify()){
//                for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
//                    try{
//                        Thread.sleep(1000);
//                    }catch (Exception e){
//
//                    }
//                    if (!new LicenseVerify().verify()){
//                        log.info("++++++++ 验证许可证失败 ++++++++");
//                    } else {
//                        log.info("++++++++ 验证许可证成功 ++++++++");
//                        licenseVerifySign = true;
//                    }
//                }
//                if (licenseVerifySignCount>10 && !licenseVerifySign){
//                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
//                } else {
//                    if (systemSign){
//                        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
//                    }
//                }
//            }
//        }
//    }
}