From 780ac3a9979e841fa5175244de7712bec61a8929 Mon Sep 17 00:00:00 2001 From: Ben Howes Date: Wed, 13 Dec 2023 11:39:28 +0000 Subject: [PATCH] Remove transaction wrapping tasks which prevents transactions from being used within the task --- pgq/decorators.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pgq/decorators.py b/pgq/decorators.py index 24c7b57..83034f9 100644 --- a/pgq/decorators.py +++ b/pgq/decorators.py @@ -84,10 +84,9 @@ def inner(queue, job): try: args = copy.deepcopy(job.args) - with transaction.atomic(): - result = fn( - queue, job, args["func_args"], JobMetaType(**args["meta"]) - ) + result = fn( + queue, job, args["func_args"], JobMetaType(**args["meta"]) + ) except Exc as e: retries = job.args["meta"].get("retries", 0) if retries < max_retries: