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

[spiders] Remove duplicate check setting types #261

Merged
merged 2 commits into from
Aug 9, 2022

Conversation

LuckyPigeon
Copy link
Collaborator

Description

When a spider get parameter from settings, there's a duplicate type checking show as follow.

if self.redis_batch_size is None:
  self.redis_batch_size = settings.getint('CONCURRENT_REQUESTS', defaults.REDIS_CONCURRENT_REQUESTS)
try:
  self.redis_batch_size = int(self.redis_batch_size)
except (TypeError, ValueError):
  raise ValueError("redis_batch_size must be an integer")

Fixes #260

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • tox -e py310
  • tox -e flake8
  • tox -e security
  • tox -e pylint

Test Configuration:

  • OS version: Ubuntu 21.04
  • Necessary Libraries (optional):

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@LuckyPigeon LuckyPigeon requested review from Germey and rmax August 9, 2022 06:12
@LuckyPigeon LuckyPigeon merged commit 0812846 into rmax:master Aug 9, 2022
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.

[spiders] remove duplicate check setting types
2 participants