mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 22:06:29 +03:00
fix: lock the database when INSERTing a webxdc update
`query_row_optional` does not hold the write lock and may fail with "database is locked" error or cause the other task such as SMTP loop to fail.
This commit is contained in:
@@ -409,6 +409,7 @@ impl Context {
|
|||||||
instance_id: &MsgId,
|
instance_id: &MsgId,
|
||||||
status_update_item: &StatusUpdateItem,
|
status_update_item: &StatusUpdateItem,
|
||||||
) -> Result<Option<StatusUpdateSerial>> {
|
) -> Result<Option<StatusUpdateSerial>> {
|
||||||
|
let _lock = self.sql.write_lock().await;
|
||||||
let uid = status_update_item.uid.as_deref();
|
let uid = status_update_item.uid.as_deref();
|
||||||
let Some(rowid) = self
|
let Some(rowid) = self
|
||||||
.sql
|
.sql
|
||||||
|
|||||||
Reference in New Issue
Block a user