Fix MySQL error 'Transactions couldn't be nested' (closes #1271)

This commit is contained in:
mdecimus 2025-03-10 20:01:47 +01:00
parent bbb1ec5977
commit b20549ce33

View file

@ -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<()> {