fix(audit): prevent state transition when no targets exist (#854)

Avoid setting AuditSystemState::Starting when target list is empty.
Now checks target availability before state transition, keeping the
system in Stopped state if no enabled targets are found.

- Check targets.is_empty() before setting Starting state
- Return early with Ok(()) when no targets exist
- Maintain consistent state machine behavior
- Prevent transient "Starting" state with no actual targets

Resolves issue where audit system would incorrectly enter Starting
state even when configuration contained no enabled targets.
This commit is contained in:
houseme
2025-11-14 20:23:21 +08:00
committed by GitHub
parent 3cf565e847
commit 55e3a1f7e0
5 changed files with 19 additions and 9 deletions
Generated
+2 -2
View File
@@ -9789,9 +9789,9 @@ dependencies = [
[[package]]
name = "wildmatch"
version = "2.6.0"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d654e41fe05169e03e27b97e0c23716535da037c1652a31fd99c6b2fad84059"
checksum = "29333c3ea1ba8b17211763463ff24ee84e41c78224c16b001cd907e663a38c68"
dependencies = [
"serde",
]