Chris Anderson Posted June 24, 2023 Posted June 24, 2023 I have observed the following behavior for several months on two different servers with multiple installs. One running cPanel and the other running Plesk. I install the Invision Community Suite and set up a cron job running once a minute. This starts the process of each task getting run at different time intervals. I then go ahead and install various marketplace apps that create tasks that are supposed to run at certain timeframes in order for them to work "as expected". Upon installing a monthly update or an update to address various fixes I see that all of the tasks are reset. I have included screenshots of a fresh install on my testbed server just a while ago: Fresh 4.7.10 Install: Upgrade to 4.7.11.1 After waiting a few minutes: As you can see above all of the tasks are reset and start afresh with a new date and time for each task to run. Resetting tasks will be particularly problematic if you have tasks that should run once every seven days or once a month. The new timeframe for these tasks will be much greater than a week or a month which might prove problematic. Weekly tasks "should" run at the very end of the week and monthly tasks "should" run at the very end of the month not simply 30 days starting on some random start date tied to an update. Having a task run 1 day and 15 minutes is also a problem as you might want that task to run consistently at some point in time but it won't, it will run 15 minutes later each and every day. These random task run times will also make it difficult to plan and successfully execute backups that have everything in an ideal state to relaunch a site again if you have to restore from the backup. If you happen to do a backup right in the middle of a task(s) and later restore it the site will be in an inconsistent state. No telling how minor or major this inconsistency will be. Subsequent restores will further aggravate the situation. This will likely cause difficulties at some point in time when a site is updated as your programming logic will expect certain things to be in the database or the database might have corrupted data. Task running times should be consistent and run at expected times that match up with that year's calendar, so weekly and monthly tasks always run at the appropriate times. As it currently stands that isn't the case.
Richard Arch Posted June 25, 2023 Posted June 25, 2023 Yes, it’s annoying. I have a similar issue with a 3rd party task that is set to run daily but there is no point having it run at say 3pm it needs to be during the early hours of the morning (1-3am). A way to achieve that is by viewing the tasks from ACP then press the Run Now icon after waiting up one night to reset it, then it will repeat every 24hrs until the next update/interruption. I've since worked out that I can update the table via sql to set the tasks next_run timestamp and progressed this to be ran hourly (external to IPS) to check and correct if necessary. OTT but it means I can get on with life. Another system that I work with has a much more elaborate method of setting up cron tasks (see attached) which would resolve this if the end user could set when the task should run. Of course, in my case the 3rd party developer could build in a time period for when their task should run.
Marc Posted June 26, 2023 Posted June 26, 2023 There arent really any tasks within the invision platform that would be cause problems by being run early in that way. If they have been reset, it will indeed be for good reason. If there are 3rd party items that should be run on specific days only, then there really should be code to allow for that within the item
Recommended Posts