Retrieve content automatically w/out running cron? (Every 5 mins cron seems too much)
jjjames - March 6, 2009 - 06:49
| Project: | Mailhandler |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Description
I want to retrieve content every 5 minutes and running cron that often is probably overkill? Any advice on this issue?
Thanks :)

#1
I'm interested in this too.
Is it possible to set up a seperate cron in cpanel to only call mailhandler?
#2
Currently not. But you could write a patch to add an interval dropdown to mailhandler settings, so that mailhandler's cron won't run on each Drupal cron.
#3
I would want Drupal cron to run every 24 hours (which it currently does) and a seperate mailhandler cron to run every (say) 10 minutes. Excuse my ignorance, but why would you want to set it so that mailhandler's cron is not run on each Drupal cron? I'm not sure how that would help....
Anyway, it would be nice if it was possible to have a standalone php file that references function mailhandler_cron() in mailhandler.module, and have the new cpanel cron call the standalone php file.
#4
I agree with JonoB on this. Would be great :)
#5
I'll happily review any submitted patch, and add the feature if it works.
#6
+1... this would really be great. I'm really tired of seeing my dblog fill up with "Cron ran successfully..." entries :)
Instead of using cron, is there a way to have a "push" system - that is, to somehow have the system alert Mailhandler when a new email arrives? I don't know anything about whatever mail APIs are being used, so maybe this isn't possible, but I think it would be preferable.
#7
could we write simple module like datasync_feedapi for DataSync ?
#8
subscribing
there has to be some way. I know messaging/notifications can send out a message instantly
#9
@Janam: that's because Drupal is firing a hook call on node creation. Unfortunately no mail transport agent / delivery agent / server (whichever is applicable in this case) is going to call a Drupal hook upon receiving an email, unless some sort of custom plugin could be written for it...
#10
Just saw this was released today...haven't installed, but wonder if it can do the job?
http://drupal.org/project/cron_control
#11
I tried the cron control module. Basically it can disable certain modules from running cron, but it won't help in this issue
#12
Please see #604664: Implement Drush commands for Mailhandler for one approach to this problem, using Drush.
I've edited this comment to redirect people to a separate feature request in order to allow that approach to be evaluated separately from this issue (the approach there will only really work for people who have commandline access and are sharp enough to use Drush).
Please use the patches and attachments on that ticket, not the ones below. The .patch below is identical to the first attached .patch on #604664: Implement Drush commands for Mailhandler, but further updates will only be submitted to that issue.
#13
Moving this comment to #604664: Implement Drush commands for Mailhandler
#14
Hi everyone- I am using the Elysia Cron module with great success. Basically, it lets your system cron hit cron.php every minute but run individual tasks (such as system_cron or mailhandler) on a slower schedule.
My setup is currently to have crontab hit cron.php every 5 minutes; in Elysia, the default cron schedule is daily at 2:45 AM (for updates and system_cron); and I have a special schedule for mailhandler of every 5 minutes.
#15
It sounds like using http://drupal.org/project/elysia_cron does the trick, and allows for a scope of tuning far beyond mailhandler. Thanks for sharing that @Dane Powell. I'm going to mark this as "won't fix" since the solution does exist, and is outside the scope of mailhandler.
#16
Great find! Do you have any sample code that will run mail handler every 5 minutes?
thanks
#17
@jjjames, with Drush and the code in #604664: Implement Drush commands for Mailhandler you can do exactly that. See the issue description for instructions.
Grabbing the zipfile is slightly easier than applying the patch, you can place the mailhandler.drush.inc file in any of the places specified in comment #1 there.