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
fix: notify autoscaled pool about newly added requests #2400
Conversation
Notify AutoscaledPool when calling `crawler.addRequests()`. This is important for crawlers in `keepAlive` mode that might have an empty queue and we don't want to wait till the next scheduled check (which might come in as much as 500ms by default). Related: https://apify.slack.com/archives/CD0SF6KD4/p1711660060498849
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should make a public method that lets you manually trigger this? LGTM otherwise
I actually had it like that initially, then I started writing the jsdoc, and I realized that the method will be called automatically from inside |
I guess for now there isn't any I can think off the top of my head, maybe in the future when we make DB storages too and people manually alter DBs we can provide it (if needed) |
If |
I was afraid of this academic debate... :] You could say this about every single quirk we have in the code base (and there are many, including the autoscaled pool class itself, welcome to javascript :D). Will add the public method, as I don't feel like arguing about such a small change. But I will be very surprised if anyone ever uses this method :] |
Oh yes, yes I will. |
Notify AutoscaledPool when calling
crawler.addRequests()
. This is important for crawlers inkeepAlive
mode that might have an empty queue and we don't want to wait till the next scheduled check (which might come in as much as 500ms by default).Related: https://apify.slack.com/archives/CD0SF6KD4/p1711660060498849