2 Commits
Author SHA1 Message Date
antonag32 a0c59cdf4c [CLA] add antonag32 to Vauxoo's CLA
I confirm I have signed the CLA and read the PR guidelines at
http://www.odoo.com/submit-pr.

closes odoo/odoo#153707

X-original-commit: abebac4d943f360427752345cd21ed2891477581
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-02-12 22:26:18 +00:00
antonag32 d22d382664 [REF] website: customizable batch/limit on _cron_unlink_old_visitors
In b69917e[1] the cron implementation was changed to unlink old visitors in
batches of 1000 records. This was meant to deal with memory/timeout
errors when dealing with large amounts of records.

However it still searches for records with no limit, which in high
record count scenarios and based on instance resources may still
generate memory/timeout errors.

Technically it could be considered "fine" for the cron to timeout since
every batch is committed, so previously unlinked records are not rolled
back and the cron should eventually delete them all.

However there are some edge cases where memory/time out errors would not
be fine, like the cron failing during the first batch, which means no
unlink operations would be committed to the database.

Errors that are "fine" also generate noise and leave administrators
wondering which errors they should ignore and which they should not. It
also alarms non-technical customers since after all, they are seeing
a reported error.

Therefore the search limit and batch size have been added as arguments
to the cron. This is completely opt-in since they have the previous
values as their defaults. This makes it easy to customize and tune the
performance of the job accordingly if required.

[1] https://github.com/odoo/odoo/commit/b69917ec0e508f8354d831525c5c48ee79b5967a

X-original-commit: e8a4b1f6a239753f66aa827e8e0d67ca4270dba3
Part-of: odoo/odoo#153707
2024-02-12 22:26:18 +00:00