Administrator
2024-03-22 c4b481069c464ba7e24e244cb7b24654864d3ec6
huaxin_client/command_manager.py
@@ -74,7 +74,7 @@
    def init(cls, trade_action_callback: TradeActionCallback,
             queue_strategy_trade_read_for_trade: multiprocessing.Queue):
        cls.action_callback = trade_action_callback
        cls.queue_strategy_trade_read = queue_strategy_trade_read_for_trade
        cls.queue_strategy_w_trade_r = queue_strategy_trade_read_for_trade
    @classmethod
    def process_command(cls, _type, client_id, result_json, sk=None):
@@ -129,10 +129,10 @@
    # 维护连接数的稳定
    def run(self, blocking=True):
        if blocking:
            self.run_process_command(self.queue_strategy_trade_read)
            self.run_process_command(self.queue_strategy_w_trade_r)
        else:
            # 接受命令
            t1 = threading.Thread(target=lambda: self.run_process_command(self.queue_strategy_trade_read), daemon=True)
            t1 = threading.Thread(target=lambda: self.run_process_command(self.queue_strategy_w_trade_r), daemon=True)
            t1.start()