mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-09-12 15:04:22 +08:00
Delete purge locks
This commit is contained in:
parent
82f7311a4d
commit
e2fc705ad7
2 changed files with 18 additions and 31 deletions
|
@ -8,7 +8,7 @@ To upgrade replace the `stalwart-mail` binary.
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
- Restore deleted e-mails (Enterprise Edition only)
|
- Restore deleted e-mails (Enterprise Edition only)
|
||||||
- Kubernetes (K8S) livenessProbe and readinessProbe endpoints
|
- Kubernetes (K8S) livenessProbe and readinessProbe endpoints.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Avoid sending reports for DMARC/delivery reports (#173)
|
- Avoid sending reports for DMARC/delivery reports (#173)
|
||||||
|
|
|
@ -251,36 +251,6 @@ impl JMAP {
|
||||||
|
|
||||||
pub async fn purge_account(&self, account_id: u32) {
|
pub async fn purge_account(&self, account_id: u32) {
|
||||||
// Lock account
|
// Lock account
|
||||||
match self
|
|
||||||
.core
|
|
||||||
.storage
|
|
||||||
.lookup
|
|
||||||
.counter_get(format!("purge:{account_id}").into_bytes())
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
Ok(count) => {
|
|
||||||
if count > 0 {
|
|
||||||
tracing::debug!(
|
|
||||||
event = "skipped",
|
|
||||||
context = "email_purge_account",
|
|
||||||
account_id = account_id,
|
|
||||||
count,
|
|
||||||
"Account is already being purged."
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
tracing::error!(
|
|
||||||
event = "error",
|
|
||||||
context = "email_purge_account",
|
|
||||||
account_id = account_id,
|
|
||||||
error = ?err,
|
|
||||||
"Failed to lock account."
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
match self
|
match self
|
||||||
.core
|
.core
|
||||||
.storage
|
.storage
|
||||||
|
@ -351,6 +321,23 @@ impl JMAP {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete lock
|
||||||
|
if let Err(err) = self
|
||||||
|
.core
|
||||||
|
.storage
|
||||||
|
.lookup
|
||||||
|
.counter_delete(format!("purge:{account_id}").into_bytes())
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
tracing::error!(
|
||||||
|
event = "error",
|
||||||
|
context = "email_purge_account",
|
||||||
|
account_id = account_id,
|
||||||
|
error = ?err,
|
||||||
|
"Failed to delete lock."
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn emails_auto_expunge(
|
pub async fn emails_auto_expunge(
|
||||||
|
|
Loading…
Add table
Reference in a new issue