# Sports Analytics Lab — the nightly prediction pipeline (02:00):
#   download new results → update the database → team + player ratings → features →
#   retrain → upcoming matches → predictions → store (the dashboard and /v1/sports read the DB).
# The worker exits at once unless the pipeline is switched on in the add-on (Predict tab ▸
# Database & daily pipeline), so the line is harmless on a box that never enabled it.
#
# ⚠️ flock -n: one run can outlast the next tick when the engine is retraining several
# leagues; without the lock two runs would train the same bundles twice.
0 2 * * * www-data /usr/bin/flock -n /run/lock/alpha-sports-daily.lock /usr/bin/nice -n 10 /usr/bin/php /var/www/alpha/bin/sports-pipeline.php cron >/dev/null 2>&1
