Skip to content

Commit

Permalink
fix: add max_instances for jobs that need it
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Feb 20, 2024
1 parent 0db9b99 commit 4ede28c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/jobs/0_xray_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def start_core():
for node_id in node_ids:
xray.operations.connect_node(node_id, config)

scheduler.add_job(core_health_check, 'interval', seconds=10, coalesce=True)
scheduler.add_job(core_health_check, 'interval', seconds=10, coalesce=True, max_instances=1)


@app.on_event("shutdown")
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/record_usages.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ def record_node_usages():
record_node_stats(params, node_id)


scheduler.add_job(record_user_usages, 'interval', coalesce=True, seconds=30)
scheduler.add_job(record_node_usages, 'interval', coalesce=True, seconds=10)
scheduler.add_job(record_user_usages, 'interval', coalesce=True, seconds=30, max_instances=1)
scheduler.add_job(record_node_usages, 'interval', coalesce=True, seconds=10, max_instances=1)

0 comments on commit 4ede28c

Please sign in to comment.