-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Greetings!
I am not 100% sure if this is intended behaviour, so I am creating an issue to clarify that.
joeflow/joeflow/runner/dramatiq.py
Lines 35 to 53 in 69bb14d
task = Task.objects.select_for_update().get(pk=task_pk, completed=None) | |
workflow = ( | |
task.content_type.model_class() | |
.objects.select_for_update(nowait=True) | |
.get(pk=workflow_pk) | |
) | |
try: | |
logger.info("Executing %r", task) | |
node = task.node | |
with_task = getattr(node, "with_task", False) | |
kwargs = {} | |
if with_task: | |
kwargs["task"] = task | |
with with_reversion(task): | |
result = node(workflow, **kwargs) | |
except OperationalError: | |
raise |
Here, we are executing queries (because we are calling .get()
, so it is not lazy) outside try-catch which I guess is supposed to log and catch it.
So I get a feeling that try-catch here is not actually doing anything.
If you agree, I am happy to provide a patch to either drop this try-catch (since we are raising OperationalError
anyways) or we move the queries inside it.
Best,
Rust
Metadata
Metadata
Assignees
Labels
No labels