2020-02-06 14:26:56 +01:00
:banner: banners/odoo_sh.png
2019-08-20 14:03:04 +02:00
.. _odoosh-advanced-frequent_technical_questions:
==================================
Frequent Technical Questions
==================================
2019-09-20 16:22:52 +02:00
"Scheduled actions do not run at the exact time they were expected"
2019-09-04 08:48:40 +02:00
-------------------------------------------------------------------
2019-09-20 16:22:52 +02:00
On the Odoo.sh platform, we cannot guarantee an exact running time for scheduled actions.
2019-09-04 08:48:40 +02:00
2019-09-20 16:22:52 +02:00
This is due to the fact that there might be multiple customers on the same server, and we must guarantee a fair share of the server for every customer. Scheduled actions are therefore implemented slightly differently than on a regular Odoo server, and are run on a *best effort* policy.
2019-09-04 08:48:40 +02:00
.. warning ::
2019-09-20 16:22:52 +02:00
Do not expect any scheduled action to be run more often than every 5 min.
2019-09-04 08:48:40 +02:00
2019-09-20 16:22:52 +02:00
Are there "best practices" regarding scheduled actions?
2019-09-09 13:44:40 +02:00
-------------------------------------------------------
2019-09-20 16:22:52 +02:00
**Odoo.sh always limits the execution time of scheduled actions (*aka* crons).**
2019-09-09 13:44:40 +02:00
Therefore, you must keep this fact in mind when developing your own crons.
We advise that:
2019-09-20 16:22:52 +02:00
- Your scheduled actions should work on small batches of records.
- Your scheduled actions should commit their work after processing each batch;
2019-09-09 13:44:40 +02:00
this way, if they get interrupted by the time-limit, there is no need to start over.
2019-09-20 16:22:52 +02:00
- Your scheduled actions should be
2019-09-09 13:44:40 +02:00
`idempotent <https://stackoverflow.com/a/1077421/3332416> `_ : they must not
cause side-effects if they are started more often than expected.