Add sql transactions
This commit is contained in:
parent
f4fbc95500
commit
4489b37a3f
3 changed files with 39 additions and 42 deletions
|
|
@ -86,9 +86,10 @@ impl Handler<Reload> for AppState {
|
|||
|
||||
fn handle(&mut self, _msg: Reload, _ctx: &mut Self::Context) -> Self::Result {
|
||||
log::debug!("Reloading controller");
|
||||
let mut pool_conn = block_on(self.pool.acquire())?;
|
||||
let mut tx = block_on(self.pool.begin())?;
|
||||
|
||||
self.this.reload(&mut pool_conn)?;
|
||||
self.this.reload(&mut tx)?;
|
||||
block_on(tx.commit())?;
|
||||
|
||||
self.notify_controller_change();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue