Tuesday, May 19, 2020
1 change · master
Code cleanup and technical improvements
Odoo’s automated cleanup process has been reorganized so each cleanup task runs independently, reducing the chance that one failure stops all maintenance work. This improves system reliability for background housekeeping across areas such as messaging, events, live chat, point of sale payments, coupons, and wishlists.
Original PR description
The ir.autovacuum model purpose is to run several garbage collecting operations like removing files from the filestore when no attachment references them anymore. The precedent strategy to register new garbage collection tasks was to override the `power_on` method and to imperatively execute a vacuum cleaning method on a given model. All calls were executed in a single SQL transaction without any error handling, meaning a single fail during any call resulted in a complete failure of the entire vacuum cleaning chain. We introduce a new `@autovacuum` api decorator, its purpose it to register garbage collecting methods that will be safely executed in their own transaction by the vacuum cleaner. In order to ensure this new strategy is used, we deprecate `power_on` extensions. Task: 2154079