Fix MySQL error 'Transactions couldn't be nested' (closes #1271)
This commit is contained in:
@@ -318,7 +318,13 @@ impl MysqlStore {
|
||||
}
|
||||
}
|
||||
|
||||
trx.commit().await.map(|_| result).map_err(Into::into)
|
||||
match trx.commit().await {
|
||||
Ok(_) => Ok(result),
|
||||
Err(err) => {
|
||||
let _ = conn.query_drop("ROLLBACK;").await;
|
||||
Err(err.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn purge_store(&self) -> trc::Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user