From 5296085d9cefabb1ea9486314a2576dd1a87e0ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20B=C3=A4r?= Date: Wed, 13 Nov 2024 13:05:31 +0100 Subject: [PATCH] fix: load `initialCount` in `openRequestQueue()` --- packages/apify/src/actor.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/apify/src/actor.ts b/packages/apify/src/actor.ts index 41f3c7275b..d83143d821 100644 --- a/packages/apify/src/actor.ts +++ b/packages/apify/src/actor.ts @@ -818,7 +818,12 @@ export class Actor { this._ensureActorInit('openRequestQueue'); - return this._openStorage(RequestQueue, queueIdOrName, options); + const queue = await this._openStorage(RequestQueue, queueIdOrName, options); + + // eslint-disable-next-line dot-notation + queue['initialCount'] = (await queue.client.get())?.totalRequestCount ?? 0; + + return queue; } /**