-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: RequestQueue.addRequest
's forefront
option doesn't work
#2669
Comments
Thank you for your report! It indeed seems that the As far as I figured, this is caused by two different problems:
crawlee/packages/memory-storage/src/resource-clients/request-queue.ts Lines 220 to 225 in 2fa8a29
I remember @vladfrangu did most of the work on RQv2 - are my assumptions correct here, or did I miss something? To be honest, I'm not sure how to solve this issue, really 🤷🏽 Maybe just add a special |
Oof, nice catch. We'll either have to collect all requests, sort, then list (which sounds super inefficient), store requests sorted (with smth like insert-sort) in-memory, or split forefront into its own map and go from there |
@prakashgp your code does not contain |
RequestQueue.addRequest
's forefront
option doesn't work
Which package is this bug report for? If unsure which one to select, leave blank
None
Issue description
Add lots of initial urls to the request queue
Once a url is scraped, add 2nd level scraping request with
forefront
= true.Records will be pushed to dataset in 2nd level scraping requests which are derived from result of 1st level request.
But due to the bug and large number of initial requests, even if we push 2nd level requests to front of the queue, they still gets scraped at the end. And because of this scraper runs for long time without adding any records to the dataset
Code sample
Package version
^3.11.3
Node.js version
v20.13.0
Operating system
Mac OS
Apify platform
I have tested this on the
next
releaseError: Detected incompatible Crawlee version used by the SDK. User installed 3.11.4-beta.0 but the SDK uses 3.11.3
Other context
No response
The text was updated successfully, but these errors were encountered: