Skip to content

Commit

Permalink
Move emit to end of transaction (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgb authored Jun 25, 2024
1 parent cc3fabd commit 6fe95a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plane/src/database/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ impl<'a> BackendDatabase<'a> {
) -> sqlx::Result<bool> {
let mut txn = self.db.pool.begin().await?;

emit_with_key(&mut *txn, &backend.to_string(), &new_state).await?;

let new_status = new_state.status();
let new_status_number = new_status.as_int();

Expand Down Expand Up @@ -255,6 +253,8 @@ impl<'a> BackendDatabase<'a> {
.await?;
}

emit_with_key(&mut *txn, &backend.to_string(), &new_state).await?;

txn.commit().await?;

Ok(true)
Expand Down

0 comments on commit 6fe95a8

Please sign in to comment.