Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sometimes (especially for a site youve migrated lots of content) you'd like to be able to run cron every 5 minutes or so to index the search. Another use case I'm finding is with using the linkchecker module for a large site (7k nodes, 30k links) - currently this is taking days to index. This patch adds extra options for 5, 10 and 30 minutes.
Perhaps 3 extra options is too many, maybe 5 and 15 minutes would suffice.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1310260-cron_time_list_patch.patch | 742 bytes | jhr |
cron-options.patch | 721 bytes | nirbhasa | |
Comments
Comment #1
madeby CreditAttribution: madeby commentedIs this possible in any way on D7?
Comment #2
nirbhasa CreditAttribution: nirbhasa commentedI think that patch should apply equally well to D7, if you want to try. However the policy is to commit to D8 dev first.
Comment #3
Bojhan CreditAttribution: Bojhan commentedWhy dont you just make a module for this? Or do it in apache, I dont really get when you are doing something this advanced - core would need to support in it.
Comment #4
jhr CreditAttribution: jhr commented@Bojhan... Another module should be written to duplicate cron's functionality?
I like this patch because it adds shorter times, my case is checking for feeds.
Maybe I'm misunderstanding how core cron is supposed to work, but core updates has the option to check for runs daily or weekly.
admin/reports/updates/settings
I think if any modules run on every cron run then that's their bad functionality.
Comment #6
jhr CreditAttribution: jhr commentedAnother Patch adding 5,10,15,30mins
Comment #7
jhr CreditAttribution: jhr commented... and a status changed
Comment #8
bagvendt CreditAttribution: bagvendt commentedOkay first time reviewing a patch here so go easy on me :)
Applied the patch and everything seems to be in order.
My only note would be that according to: this link the patch seems to reveal a problem in the cron module.
I am thinking what if someone wanted to have a cron every 27th minute or every third minute. My point -> maybe the cron intervals should be configurable in some other module.
Comment #9
jhr CreditAttribution: jhr commentedIf I understand Drupal cron & linux cron correctly, I think ideally that would be done by the system(linux) cron, and Drupal's cron would be available to run by setting a time interval shorter than an hour.
ex(if my cron-fu doesn't fail me):
Then Drupal's cron every 45 mins.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedI really believe that it's a bad logic you're applying.
Who will determine the perfect balance? What should the minimum soft-cron interval be? I say let we keep the current intervals or let the user set his own, while supplying better documentation of what cron is, and why it really should be run by a unix cron job instead.
Lets not make a halfway change, lets fix this the right way, so that we don't have this resurface when someone wants a 3 min interval, or perhaps a 15 min one.
Comment #11
bagvendt CreditAttribution: bagvendt commentedI have added a feature request over here suggesting an alternative approach to resolve this issue.
#1679660: Add link to cron tutorial on drupal.org
Comment #12
valthebald+1 to #11
Comment #13
elvis2 CreditAttribution: elvis2 commentedHere is another method, using batching: http://drupal.org/node/1679660#comment-7432824
Comment #14
valthebald@elvis2: #1679660: Add link to cron tutorial on drupal.org can provide a way of manual processing of indexing or other time-consuming operation using web UI, not a way of recurring, scheduled tasks, automatically run by the system
Comment #27
smustgrave CreditAttribution: smustgrave at Mobomo commented#11 appears to have been committed. And with no movement in 10+ years wonder if this is still a desired feature?
Comment #28
kikecastillo CreditAttribution: kikecastillo at Key Consulting commentedI would love this feature to be part of core. I understand 1 hour is enough and it should be per default but why not allow more options?