kaq-quant-common 0.2.16__py3-none-any.whl → 0.2.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,6 +146,14 @@ class LimitOrderHelper:
146
146
  # 设置停止标志
147
147
  self._stop_event.set()
148
148
 
149
+ # 取消刷新任务
150
+ if self._loop and self._flusher_task and not self._flusher_task.done():
151
+ self._loop.call_soon_threadsafe(self._flusher_task.cancel)
152
+ # 等待任务取消完成
153
+ import time
154
+
155
+ time.sleep(0.1)
156
+
149
157
  # 如果事件循环正在运行,停止它
150
158
  if self._loop and self._loop.is_running():
151
159
  self._loop.call_soon_threadsafe(self._loop.stop)
@@ -266,6 +274,10 @@ class LimitOrderHelper:
266
274
  Args:
267
275
  batch: 批量数据字典,格式为 {symbol: (data, arg)}
268
276
  """
277
+ # 如果已经停止,直接返回
278
+ if self._stop_event.is_set():
279
+ self._logger.warning("Helper 正在停止,跳过本次写入")
280
+ return
269
281
  # 转换数据
270
282
  df: Optional[pd.DataFrame] = None
271
283
  list_data: list = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kaq_quant_common
3
- Version: 0.2.16
3
+ Version: 0.2.17
4
4
  Summary:
5
5
  Author: kevinfuture
6
6
  Author-email: liuenbofuture@foxmail.com
@@ -31,7 +31,7 @@ kaq_quant_common/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
31
31
  kaq_quant_common/common/ddb_table_monitor.py,sha256=7Yihz_uGGujo_QqqPl45Gp8fwUMMw1auXx5egbzyYlE,3662
32
32
  kaq_quant_common/common/http_monitor.py,sha256=_yChiwfVv1c5g_lKgYUjWY40fX61BWVK8SL4kXwRfwk,2375
33
33
  kaq_quant_common/common/modules/funding_rate_helper.py,sha256=IHBOMZuTpCqvLlPzrB0KquqEWVeIOEEE1wBsNM4VS9g,5800
34
- kaq_quant_common/common/modules/limit_order_helper.py,sha256=ZQ4F8xgGdTCaxSzTzAoD-Bj50-kRAUigh3_sS9xoN4g,10837
34
+ kaq_quant_common/common/modules/limit_order_helper.py,sha256=WfFLpkuwXcNZ4ylpwR8YOclntElnZTeXy0oTkW0EG1Y,11288
35
35
  kaq_quant_common/common/modules/limit_order_symbol_monitor.py,sha256=TBK48qyeCSQvkfDMv3J_0UM7f3OuBRKRFYDcL9kG6Cs,2876
36
36
  kaq_quant_common/common/modules/limit_order_symbol_monitor_group.py,sha256=oEqHIwxhqAzckmluHJHZHiHUNmAyaS2JyK2nXO58UhY,2394
37
37
  kaq_quant_common/common/monitor_base.py,sha256=E4EUMsO3adNltCDNRgxkvUSbTTfKOL9S1zzN3WkZvpU,2467
@@ -65,6 +65,6 @@ kaq_quant_common/utils/signal_utils.py,sha256=zBSyEltNTKqkQCsrETd47kEBb3Q_OWUBUn
65
65
  kaq_quant_common/utils/sqlite_utils.py,sha256=UDDFKfwL0N-jFifl40HdyOCENh2YQfW5so6hRaSJpv0,5722
66
66
  kaq_quant_common/utils/uuid_utils.py,sha256=pm_pnXpd8n9CI66x3A20cOEUiriJyqHaKGCeLrgkBxU,71
67
67
  kaq_quant_common/utils/yml_utils.py,sha256=gcKjb_-uuUajBGAl5QBPIZTg2wXm7qeeJvtHflj_zOE,4513
68
- kaq_quant_common-0.2.16.dist-info/METADATA,sha256=hf4LlMoRi3iOOmLRr5kyoA_ofCrgYEWC2rrIN8j8Nq0,1971
69
- kaq_quant_common-0.2.16.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
70
- kaq_quant_common-0.2.16.dist-info/RECORD,,
68
+ kaq_quant_common-0.2.17.dist-info/METADATA,sha256=ppX4aOfK8IVasbxih76sG_-7JD9wwo7iGIJh96qkknM,1971
69
+ kaq_quant_common-0.2.17.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
70
+ kaq_quant_common-0.2.17.dist-info/RECORD,,