Skip to content

fix: ensure isFinishedFunction is re-evaluated after state restore [#2917] #3017

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TahminaAhmed18
Copy link

Summary
This pull request fixes a bug where isFinishedFunction was not evaluated after restoring from persistent state, causing the crawler to continue running even if the crawl had logically completed. This addresses the unexpected behavior reported in #2917.

Changes Introduced
Added an explicit check for isFinishedFunction immediately after this._init() in the run() method. If the function returns true, the crawler logs a message and exits early. This preserves consistent shutdown logic whether the crawl is resumed or started fresh.

Related Information
Fixes: #2917
This change improves correctness during host migration or restarts by preventing unnecessary crawling when the task is already complete.

@janbuchar
Copy link
Contributor

janbuchar commented Jun 21, 2025

How goes this PR close the issue in question (#2917)? Also, this removes the unlock call in BasicCrawler, same as your other PR. Is that intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sendRequest does not use custom proxies
2 participants