aspendigital / docker-octobercms

Dockerized October CMS: PHP, Composer, October core and dependencies
MIT License
150 stars 54 forks source link

Enabling cron can block startup process #24

Open TimFoerster opened 5 years ago

TimFoerster commented 5 years ago

When cron is enabled and scheduler is used in ocms, then the startup process blocks.

instead of

  php artisan schedule:run # required to prime db connection
  cron
  echo 'Cron enabled.'

should be

        echo 'Adding crontab job'
        echo "* * * * * /usr/local/bin/php /var/www/html/artisan schedule:run > /proc/1/fd/1 2>/proc/1/fd/2" | tee -a /var/spool/cron/root
        echo 'Starting cron service'
        service cron start
        echo 'Cron enabled.'
petehalverson commented 5 years ago

Thanks @TimFoerster, I've been wanting to address the cron process differently. I'll give this a try.