Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
9166 มุมมอง

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')" />

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ย. 23
11880
1
ส.ค. 22
4841
0
มิ.ย. 16
3579
0
ต.ค. 24
2317
1
ส.ค. 24
5274