*
L
2 天以前 1bc0b18a88ed90fa19e0c050d7befecb2a16bb8a
src/main/java/com/zy/core/MainProcess.java
@@ -22,6 +22,7 @@
    private MainServiceImpl mainService;
    // 所属线程
    private Thread thread;
    private Thread threadVerify;
    // 频率
    private int[] autoZ = new int[]{0,0,0,0,0,0,0};
@@ -66,11 +67,40 @@
            }
        });
        thread.start();
        threadVerify = new Thread(() -> {
            while (!Thread.currentThread().isInterrupted()) {
                try {
                    // 间隔
                    Thread.sleep(60000);
                    // 系统运行状态判断
                    if (!SystemProperties.WCS_RUNNING_STATUS.get()) {
                        continue;
                    }
                    try{
                        log.info("++++++++ 开始验证许可证 ++++++++");
                        if (!mainService.licenseVerify()){
                            SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
                            log.info("++++++++ 验证许可证失败 ++++++++");
                        } else {
                            SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
                            log.info("++++++++ 验证许可证成功 ++++++++");
                        }
                    } catch (Exception e) {}
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
        threadVerify.start();
    }
    @PreDestroy
    public void shutDown(){
        if (thread != null) thread.interrupt();
        if (threadVerify != null) threadVerify.interrupt();
    }
}