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

JonoB - April 29, 2009 - 22:33

I'm interested in this too.

Is it possible to set up a seperate cron in cpanel to only call mailhandler?

#2

z.stolar - April 30, 2009 - 06:37

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

JonoB - April 30, 2009 - 11:51

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

jjjames - May 1, 2009 - 10:36

I agree with JonoB on this. Would be great :)

#5

z.stolar - May 1, 2009 - 11:05
Category:support request» feature request

I'll happily review any submitted patch, and add the feature if it works.

#6

Dane Powell - September 4, 2009 - 03:09

+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

DGyn - September 10, 2009 - 18:16

could we write simple module like datasync_feedapi for DataSync ?

#8

Janam - October 11, 2009 - 00:28

subscribing

there has to be some way. I know messaging/notifications can send out a message instantly

#9

Dane Powell - October 11, 2009 - 02:08

@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

jjjames - October 11, 2009 - 08:18

Just saw this was released today...haven't installed, but wonder if it can do the job?

http://drupal.org/project/cron_control

#11

Janam - October 11, 2009 - 20:27

I tried the cron control module. Basically it can disable certain modules from running cron, but it won't help in this issue

#12

xurizaemon - October 14, 2009 - 20:37

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.

AttachmentSize
mailhandler-drush-inc.zip 1.67 KB
392782-mailhandler_drush_retrieve.patch 3.11 KB

#13

xurizaemon - October 14, 2009 - 20:38
Status:active» needs review

Moving this comment to #604664: Implement Drush commands for Mailhandler

#14

Dane Powell - November 22, 2009 - 21:22

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

Ian Ward - November 23, 2009 - 13:49
Status:needs review» won't fix

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

jjjames - November 24, 2009 - 21:22

Great find! Do you have any sample code that will run mail handler every 5 minutes?
thanks

#17

xurizaemon - November 24, 2009 - 23:38

@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.

 
 

Drupal is a registered trademark of Dries Buytaert.