#
yxFwq
2024-10-29 83894247616a45ad4201b0aa5956282936f1b18a
src/main/java/com/zy/core/ServerBootstrap.java
@@ -145,12 +145,12 @@
            SlaveConnection.put(SlaveType.Ste, ste.getId(), steThread);
        }
        // 初始化磅秤线程
//        log.info("初始化磅秤线程...................................................");
//        for (Slave scale : slaveProperties.getScale()) {
//            ScaleThread barcodeThread = new ScaleThread(scale);
//            new Thread(barcodeThread).start();
//            SlaveConnection.put(SlaveType.Scale, scale.getId(), barcodeThread);
//        }
        log.info("初始化磅秤线程...................................................");
        for (Slave scale : slaveProperties.getScale()) {
            ScaleThread barcodeThread = new ScaleThread(scale);
            new Thread(barcodeThread).start();
            SlaveConnection.put(SlaveType.Scale, scale.getId(), barcodeThread);
        }
    }
@@ -161,7 +161,7 @@
    @Component
    class killThread {
        @Scheduled(cron = "0/3 * * * * ? ")
//        @Scheduled(cron = "0/3 * * * * ? ")
        public void kill() {
            for (Map.Entry<CrnThread, Thread> entry : map.entrySet()) {
                CRN_COUNT++;