From 8ea6200de76e128b54ad51e75014b5fc051b55ca Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 13 九月 2023 13:39:56 +0800 Subject: [PATCH] 撤单机制修改 --- utils/huaxin_util.py | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/utils/huaxin_util.py b/utils/huaxin_util.py index 6b736fd..2d91c86 100644 --- a/utils/huaxin_util.py +++ b/utils/huaxin_util.py @@ -1,4 +1,8 @@ # 鎶ュ崟鐘舵�� +import threading + +from utils import tool + TORA_TSTP_OST_Cached = '0' # 棰勫煁 TORA_TSTP_OST_Unknown = '1' # 鏈煡 TORA_TSTP_OST_Accepted = '2' # 浜ゆ槗鎵�宸叉帴鏀� @@ -48,3 +52,18 @@ if state == TORA_TSTP_OST_PartTraded or state == TORA_TSTP_OST_AllTraded or state == TORA_TSTP_OST_PartTradeCanceled: return True return False + + +__order_ref_lock = threading.RLock() +__public_order_ref = int(tool.get_now_time_str().replace(":", "")) + + +# 鍒涘缓璁㈠崟寮曠敤 +def create_order_ref(): + __order_ref_lock.acquire() + try: + global __public_order_ref + __public_order_ref += 1 + return __public_order_ref + finally: + __order_ref_lock.release() -- Gitblit v1.8.0