Results 1 to 3 of 3
Thread: How Often Should I Run This
Feb 29, 2012, 15:24 #1
- Join Date
- Sep 2011
- 0 Post(s)
- 0 Thread(s)
How Often Should I Run This
Hi, my site has allows users to sign up and buy e-learning courses.
As soon as they purchase a course, they have 1 week (7 days) to START the course so the following is set as soon as the purchase has been made:
- $course_status is set to 'purchased'
- $start_timestamp is set (set to one week from the current time of the purchase)
I am running a cron job to check for courses that have not been started within the week (7 days) timeframe:
check all missions where $course_status = 'purchased'
IF $current_timestamp > $start_timestamp SET $course_status to 'not_started'
My question is, how many times should i be running this cron
a - run the cron 48 times a day (checking for courses that have not been started every 30 minutes throughout the day) (is this bad practice, would i be running the cron too often, with a possibility of slowing the site down)
b - should i add a $purchase_hour to the database and then run the cron every hour but only query courses where $purchase_hour = $current_hour (the hour at the time the cron is run)
Thanks in advance for your help on this