Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
9173 Näkymät

Is possible has a cron task every 30 seconds?

Avatar
Hylkää
Tekijä

Niyas, thanks for answer, the problem it's that I need to request an Api every 30 seconds. And the Odoo thread has a 60 seconds hardcoded limited .

Tekijä Paras vastaus

Thanks Federico, what I did was to have a dynamic next_execution_time. This way I set Next execution 30 seconds later.


Avatar
Hylkää
Paras vastaus

Old question, and I didn't try it if is possible to hack the time limit. One solution may be to make 2 cron of 60 seconds one 30 second apart. Each of them will then call the same Api function

Avatar
Hylkää
Paras vastaus

@vladimir881002 can you share your code, how you have done dynamic next_execution_time.

Avatar
Hylkää
Tekijä

<field name="nextcall" eval="(DateTime.now() + timedelta(seconds=30)).strftime('%Y-%m-%d %H:%M:%S')" />

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
syysk. 23
11884
1
elok. 22
4843
0
kesäk. 16
3581
0
lokak. 24
2321
1
elok. 24
5277