Allow Synapse user deactivation to take up to 5 minutes

This commit is contained in:
Quentin Gliech
2025-04-28 19:40:17 +02:00
parent b637e55f4a
commit 8be6b2785f

View File

@@ -4,7 +4,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
use std::collections::HashSet;
use std::{collections::HashSet, time::Duration};
use anyhow::{Context, bail};
use error::SynapseResponseExt;
@@ -476,6 +476,8 @@ impl HomeserverConnection for SynapseConnection {
let response = self
.post(&format!("_synapse/admin/v1/deactivate/{mxid}"))
.json(&SynapseDeactivateUserRequest { erase })
// Deactivation can take a while, so we set a longer timeout
.timeout(Duration::from_secs(60 * 5))
.send_traced()
.await
.context("Failed to deactivate user in Synapse")?;