From 007ca06456299bba3d9a76b00170a7c35ab0a071 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 11 Jun 2024 16:23:51 +0100 Subject: [PATCH] Lint fixes --- perfTest/types.d.ts | 9 +++++++++ src/localQueue.ts | 1 - src/main.ts | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 perfTest/types.d.ts diff --git a/perfTest/types.d.ts b/perfTest/types.d.ts new file mode 100644 index 00000000..c6a4d0b7 --- /dev/null +++ b/perfTest/types.d.ts @@ -0,0 +1,9 @@ +declare global { + namespace GraphileWorker { + interface Tasks { + latency: { id: number }; + } + } +} + +export type Foo = "Foo"; diff --git a/src/localQueue.ts b/src/localQueue.ts index d117f4a1..383a1490 100644 --- a/src/localQueue.ts +++ b/src/localQueue.ts @@ -3,7 +3,6 @@ import assert from "assert"; import { CompiledSharedOptions, EnhancedWithPgClient, - PromiseOrDirect, WorkerPoolOptions, } from "."; import { MINUTE, SECOND } from "./cronConstants"; diff --git a/src/main.ts b/src/main.ts index b5cb045d..5f86221d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -658,10 +658,11 @@ export function _runTaskList( get worker() { return concurrency === 1 ? this._workers[0] ?? null : null; }, - nudge(this: WorkerPool, n: number) { + nudge(this: WorkerPool, count: number) { if (localQueue) { localQueue.pulse(); } else { + let n = count; // Nudge up to `n` workers this._workers.some((worker) => worker.nudge() && --n <= 0); }