diff --git a/app/jobs/0_xray_core.py b/app/jobs/0_xray_core.py index 2a720dda5..3007cde25 100644 --- a/app/jobs/0_xray_core.py +++ b/app/jobs/0_xray_core.py @@ -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") diff --git a/app/jobs/record_usages.py b/app/jobs/record_usages.py index 676f4fcf6..1a048b35c 100644 --- a/app/jobs/record_usages.py +++ b/app/jobs/record_usages.py @@ -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)