feat: add internal WordPress cron runner

This commit is contained in:
bisco
2026-07-23 23:40:44 +02:00
parent f75bce3dea
commit e6ec3c94dc
15 changed files with 245 additions and 24 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/bin/sh
set -eu
cd /var/www/html
trap 'exit 0' INT TERM
interval="${WP_CRON_INTERVAL_SECONDS:-300}"
case "$interval" in
"" | *[!0-9]*)
echo "WP_CRON_INTERVAL_SECONDS must be a positive integer." >&2
exit 1
;;
esac
if [ "$interval" -lt 60 ]; then
echo "WP_CRON_INTERVAL_SECONDS must be at least 60 seconds." >&2
exit 1
fi
while [ ! -f /var/www/html/wp-load.php ]; do
sleep 10
done
until wp core is-installed >/dev/null 2>&1; do
sleep 10
done
while :; do
if ! wp cron event run --due-now >/dev/null 2>&1; then
echo "Warning: failed to run due WordPress cron events." >&2
fi
sleep "$interval" &
wait "$!"
done