Skip to content

Commit 685fd80

Browse files
committed
forcefulShutdown can be successful; channel errors separately
1 parent a60c207 commit 685fd80

File tree

3 files changed

+138
-62
lines changed

3 files changed

+138
-62
lines changed

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,11 @@ declare global {
372372

373373
poolGracefulShutdown(
374374
event: GraphileWorker.PoolGracefulShutdownEvent,
375-
): Promise<void>;
375+
): ReturnType<WorkerPool["gracefulShutdown"]>;
376376

377377
poolForcefulShutdown(
378378
event: GraphileWorker.PoolForcefulShutdownEvent,
379-
): Promise<void>;
379+
): ReturnType<WorkerPool["forcefulShutdown"]>;
380380
}
381381

382382
interface WorkerHooks {

src/interfaces.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,9 @@ export interface WorkerPool {
517517
/** @deprecated Use gracefulShutdown instead */
518518
release: () => PromiseOrDirect<void>;
519519
gracefulShutdown: (message?: string) => PromiseOrDirect<void>;
520-
forcefulShutdown: (message: string) => PromiseOrDirect<void>;
520+
forcefulShutdown: (message: string) => PromiseOrDirect<{
521+
forceFailedJobs: readonly Job[];
522+
}>;
521523
promise: Promise<void>;
522524
/** Fires 'abort' when all running jobs should stop because worker is shutting down. @experimental */
523525
abortSignal: AbortSignal;

0 commit comments

Comments
 (0)