[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. |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
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