[development] Batch API on cron

Khalid Baheyeldin kb at 2bits.com
Thu Jul 15 14:03:16 UTC 2010


Another  option to check is the job_queue module. It takes some changes to
your module, but the payoff is huge.

Check the queue_mail as an example of a module that uses job_queue.

On Thu, Jul 15, 2010 at 7:36 AM, Yves Chedemois <yched.drupal at free.fr>wrote:

>  Queue D6 backport sounds a good idea -
> http://drupal.org/project/drupal_queue
> Never tested it, though.
>
> Yves
>
> Le 15/07/2010 13:28, Sven Decabooter a écrit :
>
> That's clear, and it makes sense. Thanks Yves!
>
>  Any pointers as to how I could have large chunks of data processed on
> cron in another way?
>
>
>  Sven
>
>
>
> On Thu, Jul 15, 2010 at 1:25 PM, Yves Chedemois <yched.drupal at free.fr>wrote:
>
>> Batch API works around the PHP timeout limitation by relying on a client
>> browser to iterate separate requests, each of which stays below the time
>> limitation.
>> So yes, Batch API can only be used in a UI context, which excludes cron.
>>
>> For the same reason, it is not recommended to fire a batch processing
>> inside an API function, since you cannot ensure it will be executed in a
>> safe-for-batch context.
>>
>> Yched
>>
>> Le 15/07/2010 11:01, Sven Decabooter a écrit :
>>
>>  Hi,
>>>
>>> I'm reading contradicting posts about running Batch API processes on
>>> cron. This is for Drupal 6 BTW.
>>> I have tried implementing a batch functionality that should be run on
>>> cron, but it doesn't seem to process the work that needs to be done.
>>> I assume this is because running the cron through a commandline command
>>> doesn't allow for javascript...
>>>
>>> So my questions:
>>> - Have I implemented Batch API incorrectly, and should it normally work
>>> also on cron?
>>> - What is the best way to run a process that would normally trigger a php
>>> script timeout? Can I use the Queue module for that?
>>>
>>> I'm sure plenty of people have already tried doing this, so I'm not sure
>>> why I can find little consistent information about it.
>>>
>>> Thanks for your feedback.
>>>
>>> Sven
>>>
>>
>>
>
>


-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100715/30456161/attachment-0001.html 


More information about the development mailing list