fix: ensure worker is running before executing hook logic in multiple scripts
This commit is contained in:
@@ -22,6 +22,9 @@ export interface SessionEndInput {
|
||||
* Cleanup Hook Main Logic - Fire-and-forget HTTP client
|
||||
*/
|
||||
async function cleanupHook(input?: SessionEndInput): Promise<void> {
|
||||
// Ensure worker is running before any other logic
|
||||
await ensureWorkerRunning();
|
||||
|
||||
silentDebug('[cleanup-hook] Hook fired', {
|
||||
session_id: input?.session_id,
|
||||
cwd: input?.cwd,
|
||||
@@ -44,9 +47,6 @@ async function cleanupHook(input?: SessionEndInput): Promise<void> {
|
||||
|
||||
const { session_id, reason } = input;
|
||||
|
||||
// Ensure worker is running
|
||||
await ensureWorkerRunning();
|
||||
|
||||
const port = getWorkerPort();
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user