Skip to content

Commit

Permalink
Merge pull request #177 from diogomatoschaves/fix-pipeline-restart
Browse files Browse the repository at this point in the history
Dont stop pipeline at restart if SYMBOL_ALREADY_TRADED
  • Loading branch information
diogomatoschaves authored Mar 5, 2024
2 parents cf95258 + 016f6d1 commit ba7b45b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def startup_task(app):

response = start_symbol_trading(pipeline)

if not response["success"]:
if not response["success"] and response["code"] != "SYMBOL_ALREADY_TRADED":
logging.info(f"Pipeline {pipeline.id} could not be started. {response['message']}")

while any(is_pipeline_loading(cache, pipeline.id) for pipeline in active_pipelines):
Expand Down
1 change: 1 addition & 0 deletions data/service/blueprints/bots_api/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def stop_pipeline(pipeline_id, header='', raise_exception=False, nr_retries=3, f
if not success:
time.sleep(60 * retries)


def start_symbol_trading(pipeline):

add_pipeline_loading(cache, pipeline.id)
Expand Down

0 comments on commit ba7b45b

Please sign in to comment.