mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-09-13 23:44:40 +08:00
Fix MySQL error 'Transactions couldn't be nested' (closes #1271)
This commit is contained in:
parent
bbb1ec5977
commit
b20549ce33
1 changed files with 7 additions and 1 deletions
|
@ -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<()> {
|
||||
|
|
Loading…
Add table
Reference in a new issue