View Full Version : Scheduled Task (User Promotions) Not working correctly
Xcynic
01-11-2012, 04:19 PM
Hello! I have a problem with my User Promotions task. I have set it to run every minute since my community is not that big atm for it to cause lag/loadtime but it doesent run. I have to manually press it for it to actually perform.
It is active and everything else seems fine but it does not run when its supposed to. Any advice?
Thanks!
Scheduled tasks will only run when your site has traffic, so if you set it to run once per minute, it will only run that often if you have continuous traffic on your site.
Also, I believe the promotion scheduled task only promotes users who have been active recently (the past 24 hours, I think). But if you run it by pressing the "Run Now" button, then I think it will pronote all users who meet the requirements.
Xcynic
01-11-2012, 04:27 PM
Oh, lol. Whats the best time to set it to for a starting community for it to run frequently?
I don't know really - you could leave it at once per minute and most of the time it won't have anything to do. I guess if your site eventually gets very busy you might want to have it run less often.
Raimund
03-26-2012, 04:46 PM
Sorry for bumping this thread again, but how can i change the promotion.php NOT to check if the user has been active recently? i want the same behavior like if i press the "Run Now" button, only sheduled.
If you look at includes/cron/promotion.php around line 40, you see this:
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
" . iif(VB_AREA != 'AdminCP', "WHERE user.lastactivity >= $lastrun")
);
if you change it to this (delete everything after the first " on line 41):
[CODE] LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
"
);
Then you should always get everyone (but it might add a lot of processing, especially if you have many members and/or are running it once per minute). BTW, what I said in an earlier post wasn't correct - it processes all users active since the last time the cron job ran, not the last 24 hours).
Why did you want to do this again? It seems like if promotions are based on number of posts then there's no way that's going to change unless the user was active.
It might be a good mod if someone could come up with one that recalculated possible promotions as soon as a user posts. It might be as easy as taking the guts of this function and putting it in a plugin somewhere.
Raimund
03-27-2012, 12:34 PM
Why did you want to do this again? It seems like if promotions are based on number of posts then there's no way that's going to change unless the user was active.
Because the promotions are not used based of number of posts on our forums, but to restrict permissions to some functions (like actually posting) to any new registered user for 2 days... we have more then 27000 active members and get lots of new members who actually post like on facebook and the like (especially when it's holiday season)... it's a good way to prevent this, but we did this manually the last year. processing is not an issue, if it is, we will upgrade to the next bigger ded. server :)
thanks btw, i'll give it a try!
christon26
08-15-2012, 07:15 PM
It might be a good mod if someone could come up with one that recalculated possible promotions as soon as a user posts. It might be as easy as taking the guts of this function and putting it in a plugin somewhere.
That would be something I'd be interested in....I don't have the skill to do it myself LOL
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.