PHPfox-Official / phpfox-v4-feature-requests

phpFox Feature Request Tracker https://phpfox.com
6 stars 12 forks source link

Add Alternative Cron Job Methods #928

Open Elshara opened 4 years ago

Elshara commented 4 years ago

We need a better cron system. Something like the following would do nicely, and I'm not just talking WGet. If we could use PHPCLI that would be even safer honestly. "echo $(wget -O - 'https://yourdomain.com/cron.php?token=5e00bb5964e8c') 2>&1 >> '/home/username/public_html/cron.log'" I thought about adding a timeout to this example, the default however of 900 Seconds (15 minutes) should suffice per use. Especially when it runs once a minute, as to how I have it set now. I'm experimenting. What does this do? Makes longer jobs process without failing to start, as is the current case with curl. Newsletter app can't send mail without a superior cron job that supports at least server timeouts. Clearing cache once an hour minimum and perhaps even adding more things to cron like reverting or rebuilding core themes after changes, or language packs, etc, makes sense as well. They both would require the external loading of files via html, something wget can do nicely, curl however cannot. This is why I suggest adding a local .php script to run that is protected in pf.base. either use Curl asynchronis request on page loads, a javascript function or a php file. Otherwise wget is the only thing that gets the job done. I also recommend a visible task scheduler system for individual cron jobs that run on the system connected to phpfox. So something like app updates, core upgrades etc could happen as they come out making system administration less interactive and easier on everyone. Making this optional will help with automatic security updates being deferred in case people prefer to have older versions live. Happy New Year everyone!