| | |
| | | @Scheduled(cron = "0/1 * * * * ?") |
| | | public void stockConstraint(){ |
| | | if (stockConstraintLock.tryLock()) { |
| | | log.info("强制平仓任务:--------->开始"); |
| | | try { |
| | | List<UserPosition> userPositions = userPositionMapper.selectList(new LambdaQueryWrapper<UserPosition>().isNull(UserPosition::getSellOrderId)); |
| | | if(CollectionUtils.isNotEmpty(userPositions)){ |
| | |
| | | log.error("强制平仓任务错误:" + e.getMessage()); |
| | | } finally { |
| | | stockConstraintLock.unlock(); |
| | | log.info("强制平仓任务:--------->结束"); |
| | | } |
| | | } else { |
| | | log.info("强制平仓任务--------->上次任务还未执行完成,本次任务忽略"); |