revert: use std::thread::spawn for fire-and-forget hooks

tokio::task::spawn_blocking requires a running tokio runtime, which
breaks tests that call hook functions outside a tokio context. Since
hooks are fire-and-forget (no JoinHandle needed), std::thread::spawn
is the correct choice.
This commit is contained in:
huqiantao
2026-06-07 19:59:17 +08:00
parent 3c197d707b
commit bdf7b15bd7
+2 -2
View File
@@ -1051,8 +1051,8 @@ impl HookExecutor {
let env = env_vars.clone();
let wd = working_dir.clone();
// Spawn in a blocking task (respects tokio's thread pool limits).
tokio::task::spawn_blocking(move || {
// Spawn in a detached thread (fire-and-forget hook execution).
std::thread::spawn(move || {
let mut command = HookExecutor::build_shell_command(&cmd);
command
.current_dir(&wd)