Skip to content
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

Parallelize script #2

Merged
merged 3 commits into from
Jan 16, 2025
Merged

Parallelize script #2

merged 3 commits into from
Jan 16, 2025

Conversation

ShivanKaul
Copy link
Collaborator

Use ThreadPoolExecutor to have 10 worker threads. The script is overwhelmingly network-bound; we can easily parallelize the HTTP requests to the Cookiemonster API.

Adds a new --parallel argument to the script.

crawl.py Outdated
Comment on lines 26 to 27
parser.add_argument('-v', '--skip-vpn-check', action='store_true', dest='skip_vpn', help='Skip VPN check (default: required)')
parser.add_argument('-p', '--parallel', dest='parallel', action='store_true', help='Enable parallel crawling (default: sequential)')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(default: required) is somewhat confusing?

FWIW I think the default behavior is already clear enough without any callout here, since it's a binary toggle flag and doesn't take a value

@ShivanKaul
Copy link
Collaborator Author

ShivanKaul commented Jan 16, 2025

FYI @mschfh you can use this for running in CI, crawling is a lot faster with this (need to pass in the flag).

@ShivanKaul ShivanKaul merged commit 68d226a into main Jan 16, 2025
1 check passed
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.

2 participants