Closed (works as designed)
Project:
Drush
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Oct 2009 at 00:59 UTC
Updated:
19 Jan 2010 at 06:52 UTC
Jump to comment: Most recent file
Providing access to a specific module's hook_cron() decouples those modules which we'd like to run frequently (eg checking mail and rss) and those which are intensive.
Drupal provides only a single interval to run all cron hooks at. With this patch, Drush allows the admin to run specific module hooks at specific times, eg triggering mailhandler every five minutes (for groups / discussion sites) while firing session cleanup at 4am daily only.
This can probably be done already by calling drush eval, but then ... what can't?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 606018-drush_cron_specific.patch | 2.69 KB | xurizaemon |
Comments
Comment #1
xurizaemonComment #2
moshe weitzman commentedThis semaphore stuff is messy. The 5 minute cron will block the regular cron, and vice versa. For D7, I think this can be solved with #578676: Use queue for cron. Until then, drush eval or drush script are your friends.
Comment #3
srhaber commentedYou can also roll your own cron script that handles semaphors per module. That's the approach we take on our sites.
Comment #4
rjbrown99 commentedFor anyone that happens to come across this, here's how I am eval'ing my own cron hook.
1) Find the appropriate hook_cron call in your module. modulename_cron is what you want.
2) Figure out if any specific variables impact when it is run. In my case, there is a variable modulename_cron_last which tracks the last time the cron was run. I have to force this to 0 to get it to run.
3) Run drush:
4) Make a script and add it to your scheduler (in my case, the actual local Linux crontab)
Comment #5
moshe weitzman commentedmaybe add drush integration for elysia cron? probably not a feature for core drush cron.
Comment #6
rjbrown99 commentedI'm fine with it either way, eval works fine for me. I just did the research on how to run it in case other people came across this thread :)