[FIX] base: skip failed autovaccum

This patch prevents bugs fixed at 5d463d2 to block the database.
It was preventing the autovacuum to properly clean old records.
Failing to unlink (may have various different reasons) should not block the
autovacuum to try on other models

Closes #23455
This commit is contained in:
Martin Trigaux
2018-03-05 16:03:01 +01:00
parent 1bfe147f89
commit 8b119e2ae9
+5 -1
View File
@@ -17,7 +17,11 @@ class AutoVacuum(models.AbstractModel):
for mname in self.env:
model = self.env[mname]
if model.is_transient():
model._transient_vacuum(force=True)
try:
with cr.savepoint():
model._transient_vacuum(force=True)
except Exception as e:
_logger.warning("Failed to clean transient model %s\n%s", model, str(e))
@api.model
def _gc_user_logs(self):