kaq-quant-common 0.2.15__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.
- kaq_quant_common/common/modules/limit_order_helper.py +12 -0
- kaq_quant_common/resources/kaq_ddb_stream_write_resources.py +2 -0
- {kaq_quant_common-0.2.15.dist-info → kaq_quant_common-0.2.17.dist-info}/METADATA +1 -1
- {kaq_quant_common-0.2.15.dist-info → kaq_quant_common-0.2.17.dist-info}/RECORD +5 -5
- {kaq_quant_common-0.2.15.dist-info → kaq_quant_common-0.2.17.dist-info}/WHEEL +0 -0
|
@@ -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 = []
|
|
@@ -328,6 +328,8 @@ class KaqQuantDdbStreamMTWWriteRepository:
|
|
|
328
328
|
|
|
329
329
|
def save2stream_batch(self, df: pd.DataFrame = pd.DataFrame(), cols: list = []):
|
|
330
330
|
try:
|
|
331
|
+
if df is None or df.empty:
|
|
332
|
+
return
|
|
331
333
|
if cols is None or len(cols) <= 0:
|
|
332
334
|
for _, row in df.iterrows():
|
|
333
335
|
_args = row.tolist()
|
|
@@ -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=
|
|
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
|
|
@@ -45,7 +45,7 @@ kaq_quant_common/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
45
45
|
kaq_quant_common/resources/kaq_ddb_pool_stream_read_resources.py,sha256=q4P96rSrEcWn9ki09UD0vw00iFq_bpgOFTrRzVG7uCA,2537
|
|
46
46
|
kaq_quant_common/resources/kaq_ddb_stream_init_resources.py,sha256=0MxxbajocTFzcRD344rfZQPKOwwuqCbyoT6dQpIox-o,3349
|
|
47
47
|
kaq_quant_common/resources/kaq_ddb_stream_read_resources.py,sha256=WShsXMoL8o-JZvrtAd7H2Cg-vrE47QbsdGgURaQwiZs,3165
|
|
48
|
-
kaq_quant_common/resources/kaq_ddb_stream_write_resources.py,sha256=
|
|
48
|
+
kaq_quant_common/resources/kaq_ddb_stream_write_resources.py,sha256=tPfInTpHMpXBqreGyYic5-t02z_LlqX32S2tL3c3wTg,15210
|
|
49
49
|
kaq_quant_common/resources/kaq_mysql_init_resources.py,sha256=UcqWey6LgoMqvLq1SxK33nS6-rkViGYhzUPxcrucOks,827
|
|
50
50
|
kaq_quant_common/resources/kaq_mysql_resources.py,sha256=282jpXvYlEQNx-hicYTNBHDii85KYgN7BQQSMS9aPFM,13211
|
|
51
51
|
kaq_quant_common/resources/kaq_postgresql_resources.py,sha256=iG1eYkciI0xUIBdEpGqKGOLBFxvVrfbBoTuaOmhQ0v0,1762
|
|
@@ -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.
|
|
69
|
-
kaq_quant_common-0.2.
|
|
70
|
-
kaq_quant_common-0.2.
|
|
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,,
|
|
File without changes
|