fix: Automatically remove corrupted appservice registrations
This commit is contained in:
parent
36a3144757
commit
94c5af40cf
1 changed files with 4 additions and 1 deletions
|
|
@ -272,7 +272,10 @@ impl Service {
|
||||||
.get(id)
|
.get(id)
|
||||||
.await
|
.await
|
||||||
.and_then(|ref bytes| serde_saphyr::from_slice(bytes).map_err(Into::into))
|
.and_then(|ref bytes| serde_saphyr::from_slice(bytes).map_err(Into::into))
|
||||||
.map_err(|e| err!(Database("Invalid appservice {id:?} registration: {e:?}")))
|
.map_err(|e| {
|
||||||
|
self.db.id_appserviceregistrations.remove(id);
|
||||||
|
err!(Database("Invalid appservice {id:?} registration: {e:?}. Removed."))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read(&self) -> impl Future<Output = RwLockReadGuard<'_, Registrations>> + Send {
|
pub fn read(&self) -> impl Future<Output = RwLockReadGuard<'_, Registrations>> + Send {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue