On 02/09/13 04:12 -0700, Kaushik S wrote:
> Hi, 
>        I would like to schedule a trigger every few minutes. Could you 
> please explain what is the best way to implement this.  
> 
> I believe ir.cron is the model to use. I tried the following and it doesn't 
> work. 
>     <record model="ir.cron" id="cron_trigger_time">
>             <field name="name">Foo bar sync</field>
>             <field name="request_user" ref="res.user_admin"/>
>             <field name="user" ref="res.user_trigger"/>
>             <field name="active" eval="True"/>
>             <field name="interval_number">60</field>
>             <field name="interval_type">minutes</field>
>             <field name="number_calls">-1</field>
>             <field name="repeat_missed" eval="False"/>
>             <field name="model">foo.bar</field>
>             <field name="function">ldap_sync</field>             # This is 
> the trigger function
>             <field name="args">'ldap_server','username','password'</field> 
>    // These are the arguments to the trigger function
>         </record>

You define to run it every 60 minutes so you must wait at least 1 hour
before knowing if it runs.

> I need to talk to an ldap server and get the latest records from a table. I 
> hope its ok to use ir.cron for this kind of a thing. If not, please 
> suggest. 

It sounds strange and calling such code every minutes shall probably not
scale very well.
But without knowing more about what it is, it is difficult to give
advice.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgp3FkIN34u76.pgp
Description: PGP signature

Reply via email to