Skip to content
Snippets Groups Projects
Commit c57601a4 authored by 🥺's avatar 🥺 :transgender_flag: Committed by 🥺
Browse files

delete all active requests for the appservice when we delete it

parent dc35d06c
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,7 @@ pub(crate) async fn register_appservice(&self, yaml: Registration) -> Result<Str
///
/// * `service_name` - the name you send to register the service previously
pub(crate) async fn unregister_appservice(&self, service_name: &str) -> Result<()> {
// removes the appservice registration info
services()
.appservice
.registration_info
......@@ -160,7 +161,14 @@ pub(crate) async fn unregister_appservice(&self, service_name: &str) -> Result<(
.remove(service_name)
.ok_or_else(|| crate::Error::AdminCommand("Appservice not found"))?;
self.db.unregister_appservice(service_name)
// remove the appservice from the database
self.db.unregister_appservice(service_name)?;
// deletes all active requests for the appservice if there are any so we stop
// sending to the URL
services().sending.cleanup_events(service_name.to_owned())?;
Ok(())
}
pub(crate) async fn get_registration(&self, id: &str) -> Option<Registration> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment