Skip to content

Commit

Permalink
fix: load initialCount in openRequestQueue()
Browse files Browse the repository at this point in the history
  • Loading branch information
barjin committed Nov 13, 2024
1 parent d90cc4f commit 5296085
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/apify/src/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,12 @@ export class Actor<Data extends Dictionary = Dictionary> {

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;

Check failure on line 824 in packages/apify/src/actor.ts

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest, 16)

test/apify/actor.test.ts > Actor > new Actor({ ... }) > Storage API > openRequestQueue should open storage

TypeError: Cannot read properties of undefined (reading 'get') ❯ Actor.openRequestQueue packages/apify/src/actor.ts:824:53 ❯ test/apify/actor.test.ts:608:17

Check failure on line 824 in packages/apify/src/actor.ts

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest, 18)

test/apify/actor.test.ts > Actor > new Actor({ ... }) > Storage API > openRequestQueue should open storage

TypeError: Cannot read properties of undefined (reading 'get') ❯ Actor.openRequestQueue packages/apify/src/actor.ts:824:53 ❯ test/apify/actor.test.ts:608:17

Check failure on line 824 in packages/apify/src/actor.ts

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest, 20)

test/apify/actor.test.ts > Actor > new Actor({ ... }) > Storage API > openRequestQueue should open storage

TypeError: Cannot read properties of undefined (reading 'get') ❯ Actor.openRequestQueue packages/apify/src/actor.ts:824:53 ❯ test/apify/actor.test.ts:608:17

return queue;
}

/**
Expand Down

0 comments on commit 5296085

Please sign in to comment.