joeflow icon indicating copy to clipboard operation
joeflow copied to clipboard

Non-optimal select in `_dramatiq_task_runner`

Open amureki opened this issue 9 months ago • 0 comments

Greetings!

I am not 100% sure if this is intended behaviour, so I am creating an issue to clarify that.

https://github.com/codingjoe/joeflow/blob/69bb14d7a91c567e2a5f211d9d5e489baebbcae0/joeflow/runner/dramatiq.py#L35-L53

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

amureki avatar May 07 '24 15:05 amureki