تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
9108 أدوات العرض

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
سبتمبر 23
11782
1
أغسطس 22
4807
0
يونيو 16
3546
0
أكتوبر 24
2273
1
أغسطس 24
5179