fix misplaced lock

This commit is contained in:
Nicolás Sánchez 2026-06-04 12:45:51 -03:00
parent 5246d69063
commit 9141f4109e
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
2026.06.04:
. Proper tp_mode 2 fix
. Minor fixes to string handling.
. Fix misplaced lock
2026.06.03:
. Fixed tp mode 2 non-functional

View File

@ -262,7 +262,7 @@ def restart_pair_no_json(base: str, quote: str) -> int:
except Exception as e:
broker.logger.log_this(f"Error canceling old take profit order: {e}",2,symbol)
broker.logger.log_this(f"Cancelling old take safety orders",2,symbol)
broker.logger.log_this(f"Cancelling old safety orders",2,symbol)
for item in instance.status.get_safety_orders():
try:
broker.cancel_order(item["id"],item["symbol"])
@ -273,9 +273,10 @@ def restart_pair_no_json(base: str, quote: str) -> int:
running_traders.remove(instance)
except ValueError:
broker.logger.log_this(f"Instance {instance.status.get_pair()} not found in running_traders.",1,instance.status.get_pair())
add_instance(base,quote)
return 0
return 1
else:
return 1
add_instance(base,quote)
return 0
except Exception as e:
broker.logger.log_this(f"Exception in restart_pair_no_json: {e}",1,symbol)
return 1