Rules Scheduler is only running its tasks on cron. But if you don't run cron very frequently (say every 30 minutes) then the scheduling becomes delayed.
For time critical tasks lite sending out tweets, publishing content or emails this deleyed is bad, or it's at least confusing (i.e. #1615472: Scheduled tasks is not executing at scheduled time.).
There are very good reasons for being able to process the rules_scheduler_tasks
queue separately. And the best way would of course be via Drush.
The attached patch adds Drush integration for Rules Scheduler with one command that:
- Adds schedules tasks to the queue
- Optionally claims and works on tasks for a specified amount of time
Some minor improvements can be made to the patch, like creating a common helper function shared between rules_scheduler_cron()
and drush_rules_scheduler_tasks()
for adding tasks to the queue. But this is quick and low-impact patch for initial review.
Comment | File | Size | Author |
---|---|---|---|
#2 | rules-scheduler-drush-2.patch | 5.14 KB | dixon_ |
#2 | interdiff.txt | 4.92 KB | dixon_ |
rules-scheduler-drush-0.patch | 3.18 KB | dixon_ | |
Comments
Comment #1
fagoGreat patch - thanks!
Shouldn't those strings use dt() ?
rusch - I like ;-)
Else, patch looks good to me. So let's go ahead and do this small code re-factoring to avoid the duplicated code to become out of sync later on.
Comment #2
dixon_Fixed.
Fixed.
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedActually, you don't need dt() in command definitions. Drush calls dt() as needed for these strings.
Comment #4
fagoIndeed, I'm sry for that. So I fixed that and committed it.
Great addition - thanks!
Comment #5.0
(not verified) CreditAttribution: commentedBetter wording.