import schedule
import time
from run_analysis import run_analysis_pipeline

def job():
    print("Running daily analysis...")
    # Analyze last 24 hours
    run_analysis_pipeline(days=1)

# Schedule for 03:00 AM
schedule.every().day.at("03:00").do(job)

print("Scheduler started...")
while True:
    schedule.run_pending()
    time.sleep(60)