From f40fd66486688042f2c68f7ba73b2e9941d34b87 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Thu, 4 Dec 2025 14:12:00 +0100 Subject: [PATCH] feat: Add time-restricted scheduling for worker2 (noise constraint) - Worker2 (bd-host01) now only runs 19:00-06:00 due to noise - Added is_worker_allowed_to_run() function for time-based control - Worker1 continues 24/7 operation - Reset stuck chunk 14 that was blocking progress since Dec 2 --- cluster/v9_advanced_coordinator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cluster/v9_advanced_coordinator.py b/cluster/v9_advanced_coordinator.py index 07e2cac..3da60fe 100755 --- a/cluster/v9_advanced_coordinator.py +++ b/cluster/v9_advanced_coordinator.py @@ -27,6 +27,9 @@ WORKERS = { 'host': 'root@10.20.254.100', 'workspace': '/home/backtest_dual/backtest', 'ssh_hop': 'root@10.10.254.106', + 'time_restricted': True, # Only run during off-hours due to noise + 'allowed_start_hour': 19, # 7 PM + 'allowed_end_hour': 6, # 6 AM } } @@ -289,6 +292,12 @@ def main(): # Assign work to idle workers for worker_name in WORKERS.keys(): + # Check if worker is allowed to run (time restrictions) + if not is_worker_allowed_to_run(worker_name): + if iteration % 10 == 0: # Log every 10 iterations to avoid spam + print(f"⏰ {worker_name} not allowed (office hours, noise restriction)") + continue + # Check if worker is idle (simplified: assume one chunk per worker) conn = sqlite3.connect(DB_PATH) cursor = conn.cursor()