Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
9017 Vizualizări

Is possible has a cron task every 30 seconds?

Imagine profil
Abandonează
Autor

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 .

Autor Cel mai bun răspuns

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


Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

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

Related Posts Răspunsuri Vizualizări Activitate
3
sept. 23
11604
1
aug. 22
4721
0
iun. 16
3463
0
oct. 24
2168
1
aug. 24
5065