-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscheduler.py
More file actions
28 lines (20 loc) · 961 Bytes
/
Copy pathscheduler.py
File metadata and controls
28 lines (20 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import time
import subprocess
from brain.messenger import messenger
from memory.status_manager import status_manager
def start_scheduler():
cycle_interval = 5 * 3600 # 5 Hours
messenger.send_message("🤖 *SEED Scheduler Started*\nSistem akan berjalan setiap 5 jam.")
while True:
try:
current_ctx = status_manager.get_context()
messenger.send_message(f"🔄 *Starting New Evolution Cycle*\n{current_ctx}")
# Run the evolution process
subprocess.run(["python3", "main.py"], check=True)
messenger.send_message(f"😴 *Evolution Cycle Complete.*\nMenunggu 5 jam untuk tahap berikutnya.")
except Exception as e:
print(f"Scheduler Error: {e}")
messenger.send_message(f"⚠️ *Scheduler Error*\n{str(e)}")
time.sleep(cycle_interval)
if __name__ == "__main__":
start_scheduler()