diff --git a/packages/host/app/lib/browser-queue.ts b/packages/host/app/lib/browser-queue.ts index a727b04d12..e8d401d9d0 100644 --- a/packages/host/app/lib/browser-queue.ts +++ b/packages/host/app/lib/browser-queue.ts @@ -28,6 +28,7 @@ export class BrowserQueue implements Queue { get isDestroyed() { return this.#isDestroyed; } + get hasStarted() { return this.#hasStarted; } @@ -76,7 +77,7 @@ export class BrowserQueue implements Queue { }, 250); private async drainJobs() { - await this.#flush; + await this.flush(); let jobsDrained: () => void; this.#flush = new Promise((res) => (jobsDrained = res)); @@ -106,6 +107,6 @@ export class BrowserQueue implements Queue { async destroy() { this.#isDestroyed = true; - await this.#flush; + await this.flush(); } } diff --git a/packages/host/tests/unit/queue-test.ts b/packages/host/tests/unit/queue-test.ts index 6d30f5f415..c87d69c8dd 100644 --- a/packages/host/tests/unit/queue-test.ts +++ b/packages/host/tests/unit/queue-test.ts @@ -26,6 +26,7 @@ module('Unit | queue | browser implementation', function (hooks) { }); test(`a job can throw an exception`, async function (assert) { + queue.register('increment', async (a: number) => a + 1); queue.register('boom', async () => { throw new Error('boom!'); }); @@ -33,7 +34,6 @@ module('Unit | queue | browser implementation', function (hooks) { queue.publish('boom', null), queue.publish('increment', 17), ]); - queue.register('increment', async (a: number) => a + 1); // assert that the error that was thrown does not prevent subsequent jobs // from running diff --git a/packages/runtime-common/package.json b/packages/runtime-common/package.json index cc83838aa3..51aaaeeeb7 100644 --- a/packages/runtime-common/package.json +++ b/packages/runtime-common/package.json @@ -48,7 +48,6 @@ "recast": "^0.23.4", "super-fast-md5": "^1.0.1", "transform-modules-amd-plugin": "workspace:*", - "typescript-memoize": "^1.1.1", "uuid": "^9.0.1" }, "devDependencies": { diff --git a/packages/runtime-common/queue.ts b/packages/runtime-common/queue.ts index 69afdd0d81..e5d3b0f358 100644 --- a/packages/runtime-common/queue.ts +++ b/packages/runtime-common/queue.ts @@ -1,5 +1,4 @@ import { PgPrimitive } from './expression'; -import { Memoize } from 'typescript-memoize'; import { Deferred } from './deferred'; export interface QueueOpts { @@ -31,7 +30,6 @@ export class Job { public uuid: string, private notifier: Deferred, ) {} - @Memoize() get done(): Promise { return this.notifier.promise; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b62363dea5..b2f0c6c0b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1692,9 +1692,6 @@ importers: transform-modules-amd-plugin: specifier: workspace:* version: link:../../vendor/transform-modules-amd-plugin - typescript-memoize: - specifier: ^1.1.1 - version: 1.1.1 uuid: specifier: ^9.0.1 version: 9.0.1