#!/bin/bash

# Navigate to the correct directory
cd /home/aiteam/pcaa-dev/dashboard-backend

echo "Starting Orchestrator Loop for BID 1713. Running every 5 minutes."

while true; do
    echo "--- [$(date)] Executing orchestrate_pipeline.py ---"
    
    # Run the orchestrator with an increased limit to clear any backlog
    python3 orchestrate_pipeline.py --bid 1713 --limit 2
    
    echo "--- [$(date)] Finished iteration. Sleeping for 5 minutes ---"
    
    # Sleep for 300 seconds (5 minutes)
    sleep 300
done
