| | |
| | | |
| | | |
| | | @EventListener(ApplicationReadyEvent.class) |
| | | private void start(){ |
| | | private void start() { |
| | | // redis.deleteList(RedisConstant.AGV_DATA_FLAG); |
| | | thread = new Thread(() -> { |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | |
| | | // 间隔 |
| | | Thread.sleep(10); |
| | | |
| | | if (configService.getVal("stopDownData", Boolean.class)) { return; } |
| | | if (!configService.getVal("stopDownData", Boolean.class)) { |
| | | AgvProtocol protocol = redis.pop(RedisConstant.AGV_DATA_FLAG); |
| | | if (null != protocol) { |
| | | |
| | | AgvProtocol protocol = redis.pop(RedisConstant.AGV_DATA_FLAG); |
| | | if (null != protocol){ |
| | | |
| | | agvDataService.dataProcess(protocol); |
| | | agvDataService.dataProcess(protocol); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception ignore) {} |
| | | } catch (Exception ignore) { |
| | | } |
| | | } |
| | | }); |
| | | thread.start(); |
| | | } |
| | | |
| | | @PreDestroy |
| | | public void shutDown(){ |
| | | public void shutDown() { |
| | | if (thread != null) thread.interrupt(); |
| | | } |
| | | |