diff --git a/src/service/rooms/roles/mod.rs b/src/service/rooms/roles/mod.rs index 04c469aa..62436828 100644 --- a/src/service/rooms/roles/mod.rs +++ b/src/service/rooms/roles/mod.rs @@ -834,6 +834,9 @@ impl Service { ) { let this = Arc::clone(self); self.server.runtime().spawn(async move { + if !this.server.running() { + return; + } if event_type != SPACE_CASCADING_EVENT_TYPE && !this.is_enabled_for_space(&space_id).await { @@ -924,6 +927,9 @@ impl Service { ) { let this = Arc::clone(self); self.server.runtime().spawn(async move { + if !this.server.running() { + return; + } if !this.is_enabled_for_space(&space_id).await { return; } @@ -1025,6 +1031,9 @@ impl Service { let this = Arc::clone(self); self.server.runtime().spawn(async move { + if !this.server.running() { + return; + } if !this.is_enabled_for_space(&space_id).await { return; }