#!/bin/sh # Harvest loop. Stays idle (no export, no enqueue) until the alt-account token and # guild id are configured, so deploying the stack unconfigured is harmless. set -u POLL_INTERVAL="${POLL_INTERVAL:-21600}" while true; do # Route any completed downloads first (fast; independent of Discord access), # then export + enqueue new threads. python3 /app/handoff.py || echo "[romhacks] handoff failed (exit $?)" if [ -z "${DISCORD_TOKEN:-}" ] || [ -z "${GUILD_ID:-}" ]; then echo "[romhacks] DISCORD_TOKEN/GUILD_ID not set — idle. Sleeping ${POLL_INTERVAL}s." else python3 /app/orchestrate.py || echo "[romhacks] cycle failed (exit $?)" fi sleep "${POLL_INTERVAL}" done