Question

How do scripts such as vBulletin launch regular maintenance jobs without cron jobs? For example, vBulletin does not update thread view counts in real-time, and only does so hourly according to their documentation. However, they don't use cron jobs to do that, so how do they do it?

I ask because I would like to do something similar on one of my sites, but don't know how they do this magic?

Was it helpful?

Solution

@Mitzimoto is correct. https://www.vbulletin.com/docs/html/scheduled_tasks_intro

vBulletin’s scheduled tasks system does not constantly run on the server like cron and scheduled tasks in Windows®. Tasks are automatically run when a user browses your board, so if your board does not have any traffic at a given time, tasks scheduled to run then will not run until later. vBulletin’s scheduled tasks also will not run when you board is turned off.

OTHER TIPS

I believe they use page loads and timestamps. In other words, every time your forum receives a page view, it checks the current time against the time of the next scheduled job. If the current time is >= the scheduled time, the job will run.

Of course, the downside to this is that if your forum doesn't get a lot of page views you can't guarantee a job will run at a specific time. The accuracy is directly related to the activity on your forum.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top