fix(spaces): add server.running() guards to spawned enforcement tasks
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 4s
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 5s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 4s
Check server.running() at the start of each spawned task to avoid doing enforcement work during shutdown, matching the codebase's established pattern for short-lived spawned tasks.
This commit is contained in:
parent
89074c9741
commit
2fbbf76692
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue