I want to retrieve content every 5 minutes and running cron that often is probably overkill? Any advice on this issue?
Thanks :)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | mailhandler-drush-inc.zip | 1.67 KB | xurizaemon |
| #12 | 392782-mailhandler_drush_retrieve.patch | 3.11 KB | xurizaemon |
Comments
Comment #1
JonoB commentedI'm interested in this too.
Is it possible to set up a seperate cron in cpanel to only call mailhandler?
Comment #2
z.stolar commentedCurrently 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.
Comment #3
JonoB commentedI 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.
Comment #4
jjjames commentedI agree with JonoB on this. Would be great :)
Comment #5
z.stolar commentedI'll happily review any submitted patch, and add the feature if it works.
Comment #6
danepowell commented+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.
Comment #7
DGyn commentedcould we write simple module like datasync_feedapi for DataSync ?
Comment #8
BetaTheta commentedsubscribing
there has to be some way. I know messaging/notifications can send out a message instantly
Comment #9
danepowell commented@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...
Comment #10
jjjames commentedJust saw this was released today...haven't installed, but wonder if it can do the job?
http://drupal.org/project/cron_control
Comment #11
BetaTheta commentedI tried the cron control module. Basically it can disable certain modules from running cron, but it won't help in this issue
Comment #12
xurizaemonPlease 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.
Comment #13
xurizaemonMoving this comment to #604664: Implement Drush commands for Mailhandler
Comment #14
danepowell commentedHi 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.
Comment #15
Ian Ward commentedIt 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.
Comment #16
jjjames commentedGreat find! Do you have any sample code that will run mail handler every 5 minutes?
thanks
Comment #17
xurizaemon@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.
Comment #18
BetaTheta commentedI found another way if anyone is interested. There's websites out there that allow you to run crons every minute without overloading your server. I recently started using such a site, http://www.webbasedcron.com/. So basically, it has a 15-days trial and lets you run cron each minute.
Once I started using this service, everything worked smoothly.
Comment #19
xurizaemon@Janam, glad you found a solution for your needs.
However, it is not a fix for this issue, which is about executing the mailhandler cron portion without triggering the cron jobs of other modules.
Some modules trigger intensive tasks on cron, which you wouldn't want to execute so many times an hour. For mailhandler, triggering the cron portion frequently makes sense if you're running an active discussion group.
One solution to that problem is #604664: Implement Drush commands for Mailhandler but there are others.
Comment #20
cor3huis commentedWell, supercron http://drupal.org/project/supercron can do all of this very well, finegrained cron per module. This is not an issue as of mailhandler since you are free to implement cronhandling in Drupal in any way you like.
Comment #21
dafederNote for mailhandler-6.x-2.x, if you're using something like Elysia cron, you need to schedule job_scheduler, not mailhandler or feeds.
Comment #22
ITra commentedHi Dane,
In Drupal 7.23, I didn't see a mailhandler_cron task within Elysia Cron. Did you do any special setting?
Thanks!
Comment #23
danepowell commented@ITra - read the comment right above yours:
This goes for 7.x-2.x as well.
Comment #24
hanksterr7 commentedOk, I'm confused.
I have drupal 7.23, mailhandler 7.x-2.5 , Elysia cron 7.x-2.1, and feeds 7.x-2.0-alpha8.
I go to cron settings page (admin/config/system/cron) and run job_scheduler_cron manually via the [run] link next to job_scheduler_cron. I then look in Recent Log Messages (admin/reports/dblog) and filter for mailhandler messages. Nothing shows up. The cron settings page shows that job_scheduler_cron ran.
Now I click the Run Cron button on cron settings page.
I re-display the mailhandler messages in dbLog and now I see that the mailhandlers have done their thing.
So why is running job_scheduler_cron direclty not causing the mailhandlers to execute?
Help?
Thanks
Comment #25
danepowell commentedI haven't used Elysia Cron in ages- it might be that there's another cron besides just job_scheduler that needs to be run. You might need to run job_scheduler_cron and feeds_cron in succession.
You might also check the Feeds Importer to make sure it's set to import "as often as possible."
If it still doesn't work, I'd suggest checking the Feeds queue- this is a really a problem with Feeds, not Mailhandler. Although if you find a solution, I'll mention it in the documentation.