跳至內容
選單
此問題已被標幟
3 回覆
9099 瀏覽次數

Is possible has a cron task every 30 seconds?

頭像
捨棄
作者

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 .

作者 最佳答案

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


頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

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

頭像
捨棄
作者

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

相關帖文 回覆 瀏覽次數 活動
3
9月 23
11770
1
8月 22
4798
0
6月 16
3536
0
10月 24
2265
1
8月 24
5166