Clear tasks when transaction is rollback

The tasks records are removed on rollback so there is no need to try to run
them.
(grafted from d2e0256f3478213d5c1ab375bc842c1222157692)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2023-02-19 20:58:01 +01:00
1 parent 8421b34613
commit 6ab873702d
1 file changed
+1
+1
View File
@@ -189,6 +189,7 @@ def _dispatch(request, pool, *args, **kwargs):
except backend.DatabaseOperationalError:
if count and not rpc.readonly:
transaction.rollback()
transaction.tasks.clear()
continue
logger.error(log_message, *log_args, exc_info=True)
raise