From 424bcd82bf3c7d40b5bcd001c64bbbe77e7d299a Mon Sep 17 00:00:00 2001 From: Avunu LLC Date: Wed, 11 Sep 2024 22:17:14 -0400 Subject: [PATCH] feat: wp-cron in worker --- docker-entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 49ce0b3..a7a5d32 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -72,4 +72,13 @@ fi # cp -r /mu-plugins /var/www/html/wp-content/mu-plugins # chmod 755 /var/www/html/wp-content/mu-plugins +# if PROC_TYPE=worker, then run cron jobs on the minute via wp-cli +if [ "$PROC_TYPE" = "worker" ]; then + echo "Running cron jobs on the minute" + while true; do + wp cron event run --all --due-now --allow-root + sleep 60 + done +fi + exec "$@" \ No newline at end of file