Skip to content

Commit 792d09b

Browse files
AgentEnderFrozenPandaz
authored andcommitted
fix(core): show better log message when isolated plugin shuts down after hook completion (#34922)
## Current Behavior `shut down after last hook` ## Expected Behavior `shut down after [hook]` ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # (cherry picked from commit 068db9a)
1 parent c4efa82 commit 792d09b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/nx/src/project-graph/plugins/isolation/isolated-plugin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class IsolatedPlugin implements LoadedNxPlugin {
280280

281281
this.lifecycle = new PluginLifecycleManager(registeredHooks);
282282

283-
const shutdown = () => this.shutdownIfInactive();
283+
const shutdown = (hookName: Hook) => this.shutdownIfInactive(hookName);
284284
const wrap = <TArgs extends unknown[], TReturn>(
285285
hook: Hook,
286286
hookFn: (...args: TArgs) => Promise<TReturn>
@@ -291,7 +291,7 @@ export class IsolatedPlugin implements LoadedNxPlugin {
291291
await this.ensureAlive();
292292
return hookFn(...args);
293293
},
294-
shutdown
294+
() => shutdown(hook)
295295
);
296296

297297
if (loadResult.createNodesPattern) {
@@ -425,22 +425,22 @@ export class IsolatedPlugin implements LoadedNxPlugin {
425425
});
426426
}
427427

428-
private shutdownIfInactive(): void {
428+
private shutdownIfInactive(hookName: Hook): void {
429429
if (this.pendingCount > 0) {
430430
logger.verbose(
431431
`[isolated-plugin] worker for "${this.name}" has ${this.pendingCount} pending request(s), not shutting down yet`
432432
);
433433
return;
434434
}
435435
logger.verbose(
436-
`[isolated-plugin] shutting down worker for "${this.name}" after last hook`
436+
`[isolated-plugin] shutting down worker for "${this.name}" after ${hookName}`
437437
);
438438
this.shutdown();
439439
}
440440

441441
notifyPhaseAborted(phase: Phase, lastCompletedHook: Hook): void {
442442
if (this.lifecycle?.notifyPhaseAborted(phase, lastCompletedHook)) {
443-
this.shutdownIfInactive();
443+
this.shutdownIfInactive(lastCompletedHook);
444444
}
445445
}
446446

0 commit comments

Comments
 (0)