Skip to content

Commit

Permalink
forcefulShutdown can be successful; channel errors separately
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Nov 22, 2024
1 parent 71c0e88 commit 251f061
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 62 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ declare global {

poolGracefulShutdown(
event: GraphileWorker.PoolGracefulShutdownEvent,
): Promise<void>;
): ReturnType<WorkerPool["gracefulShutdown"]>;

poolForcefulShutdown(
event: GraphileWorker.PoolForcefulShutdownEvent,
): Promise<void>;
): ReturnType<WorkerPool["forcefulShutdown"]>;
}

interface WorkerHooks {
Expand Down
4 changes: 3 additions & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ export interface WorkerPool {
/** @deprecated Use gracefulShutdown instead */
release: () => PromiseOrDirect<void>;
gracefulShutdown: (message?: string) => PromiseOrDirect<void>;
forcefulShutdown: (message: string) => PromiseOrDirect<void>;
forcefulShutdown: (message: string) => PromiseOrDirect<{
forceFailedJobs: readonly Job[];
}>;
promise: Promise<void>;
/** Fires 'abort' when all running jobs should stop because worker is shutting down. @experimental */
abortSignal: AbortSignal;
Expand Down
Loading

0 comments on commit 251f061

Please sign in to comment.