From c4aabe264e8f2a6002116a20b3f0b27db99c0afd Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Tue, 02 Feb 2021 18:46:40 +0800 Subject: [PATCH] modify --- src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java index 1f4adb0..5eb283a 100644 --- a/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java +++ b/src/main/java/com/xcong/excoin/rabbit/pricequeue/WebsocketPriceService.java @@ -339,12 +339,17 @@ continue; } - dataModelMap.remove(entry.getKey()); - redisUtils.set(AppContants.WHOLE_BOMB_MAP, JSONObject.toJSONString(dataModelMap)); - log.info("全仓爆仓触发:{}", JSONObject.toJSONString(wholePriceData)); - wholePriceData.setPrices(prices); - contractHoldOrderDao.updateMemberAllHoldOrderClosingStatus(wholePriceData.getMemberId()); - orderProducer.sendWholeBomb(JSONObject.toJSONString(wholePriceData)); + synchronized (this) { + if (entry.getKey() != null) { + dataModelMap.remove(entry.getKey()); + wholePriceData.setEquity(wholePriceData.getBalance().add(totalProfitOrLoss)); + redisUtils.set(AppContants.WHOLE_BOMB_MAP, JSONObject.toJSONString(dataModelMap)); + log.info("全仓爆仓触发:{}", JSONObject.toJSONString(wholePriceData)); + wholePriceData.setPrices(prices); + contractHoldOrderDao.updateMemberAllHoldOrderClosingStatus(wholePriceData.getMemberId()); + orderProducer.sendWholeBomb(JSONObject.toJSONString(wholePriceData)); + } + } } } } -- Gitblit v1.9.1