fix(upload): isolate cron jobs in worker

This commit is contained in:
2026-08-02 18:21:31 +07:00 Unverified
parent 53606c60af
commit dbf8e345a3
7 changed files with 28 additions and 35 deletions
@@ -1,18 +0,0 @@
#!/bin/sh
set -eu
upload_cron_lock=/tmp/erika-video-upload-cron.lock
if ! mkdir "$upload_cron_lock" 2>/dev/null; then
echo "Previous scheduled video upload run is still active; skipping this minute."
exit 0
fi
trap 'rmdir "$upload_cron_lock"' EXIT INT TERM
wget -q -O /dev/null \
--header="Authorization: Bearer ${CRON_SECRET}" \
http://app:3000/api/cron/video-uploads || {
echo "Scheduled video upload processing failed." >&2
exit 1
}
+1 -1
View File
@@ -1 +1 @@
* * * * * /usr/local/bin/process-scheduled-video-uploads
* * * * * bun run worker/video-upload.ts