[Apalis \W Postgres Backend] Push a task as part of a postgres transaction #745
|
So, I'd like to be able to do something like: let storage = PostgresStorage::new(&mut transaction);
storage.push_task()
// ...I have a use case where I need to store data in the DB and then push a task to apalis, and I want to be able to commit all that as part of a single transaction. Right now it looks like it is not possible because PostgresStorage depends directly on a PgPool struct. |
Answered by
geofmureithi
May 8, 2026
Replies: 1 comment 1 reply
|
You can use push_tasks which should allow you pass in the sqlx transaction. You will need to encode the task yourself and pass in a config |
1 reply
Answer selected by
JasterV
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use push_tasks which should allow you pass in the sqlx transaction. You will need to encode the task yourself and pass in a config