Skip to content

refactor(cronjobs): migrate mass_scanners, firehol, and spamhaus_drop to HttpClient.#1309

Open
Prasad8830 wants to merge 3 commits intoGreedyBear-Project:developfrom
Prasad8830:refactor/migrate-batch2-1214
Open

refactor(cronjobs): migrate mass_scanners, firehol, and spamhaus_drop to HttpClient.#1309
Prasad8830 wants to merge 3 commits intoGreedyBear-Project:developfrom
Prasad8830:refactor/migrate-batch2-1214

Conversation

@Prasad8830
Copy link
Copy Markdown

Description

This PR handles the second batch of standardising our cron jobs HTTP fetchers, as discussed in #1214.

It migrates the mass_scanners, firehol, and spamhaus_drop endpoints to utilise the new centralised HttpClient wrapper introduced in #1253. This refactor replaces ad-hoc requests.get calls with the shared client, ensuring standardised error handling, built-in logging, and automatic retries for server errors.

For firehol and spamhaus_drop, the original explicit timeout=60 argument was intentionally preserved to prevent large blocklist fetches from failing due to premature timeouts.

Related issues

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Please complete this checklist carefully. It helps guide your contribution and lets maintainers verify that all requirements are met.

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop (via the wrapper branch).
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behaviour that is described in the docs. If so, I also included an update to the wiki in the description of this PR.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it runs these checks and makes these adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

GUI changes

Ignore this section if you did not make any changes to the GUI.

  • I have provided a screenshot of the result in the PR.
  • I have created new frontend tests for the new component or updated existing ones.

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.

1 participant