Skip to content

fix: replace hardcoded timeout with DEFAULT_TIMEOUT constant#296

Open
liu57liu456 wants to merge 1 commit into
ambicuity:mainfrom
liu57liu456:fix/default-timeout-constant
Open

fix: replace hardcoded timeout with DEFAULT_TIMEOUT constant#296
liu57liu456 wants to merge 1 commit into
ambicuity:mainfrom
liu57liu456:fix/default-timeout-constant

Conversation

@liu57liu456
Copy link
Copy Markdown

@liu57liu456 liu57liu456 commented May 26, 2026

What

Replaced hardcoded timeout=5 with DEFAULT_TIMEOUT constant in Google Jobs fetch.

Why

DEFAULT_TIMEOUT already defined (line 70) and used by all other fetch functions. Last hardcoded instance.

Closes #58

Summary by CodeRabbit

  • Chores
    • Updated timeout configuration for job data retrieval operations to use standardized settings, improving consistency across the system.

Review Change Stack

The DEFAULT_TIMEOUT constant was defined but not used in one
AGGRESSIVE Google Jobs fetch call, which had a hardcoded 5.

Closes ambicuity#58
@liu57liu456 liu57liu456 requested a review from ambicuity as a code owner May 26, 2026 15:36
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6a9bce43-ce68-41d7-995e-e1643364a812

📥 Commits

Reviewing files that changed from the base of the PR and between 0ae8b94 and f2cc2e7.

📒 Files selected for processing (1)
  • scripts/update_jobs.py
 ________________________________________________
< Press W-A-S-D to move me around your codebase. >
 ------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve clean reviews and PRs whose review comments are fully resolved.

Enable the reviews.request_changes_workflow setting to allow automatic approval for clean reviews, approval after CodeRabbit comments are resolved, and explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces a hardcoded timeout value of 5 seconds with the constant DEFAULT_TIMEOUT in the fetch_single_term function within scripts/update_jobs.py. There are no review comments to address, and the change looks clean and correct.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6a9bce43-ce68-41d7-995e-e1643364a812

📥 Commits

Reviewing files that changed from the base of the PR and between 0ae8b94 and f2cc2e7.

📒 Files selected for processing (1)
  • scripts/update_jobs.py

📝 Walkthrough

Walkthrough

A single timeout parameter in the Google Careers parallel fetch worker is refactored to use the shared DEFAULT_TIMEOUT constant instead of a hard-coded 5 seconds, eliminating a magic number and promoting consistency with other HTTP request timeouts in the module.

Changes

Timeout Constant Adoption

Layer / File(s) Summary
Google parallel worker timeout constant
scripts/update_jobs.py
The limited_get() call in fetch_google_jobs_parallel's per-search-term worker is updated to use DEFAULT_TIMEOUT instead of the literal 5 second timeout value.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • ambicuity

Poem

A rabbit hops with careful thought,
One timeout constant, lessons taught—
No magic fives shall roam the code,
Just DEFAULT_TIMEOUT down the road! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing a hardcoded timeout value with the DEFAULT_TIMEOUT constant.
Linked Issues check ✅ Passed The PR addresses issue #58 by replacing the last hardcoded timeout=5 with the existing DEFAULT_TIMEOUT constant, fulfilling the requirement to use the constant for HTTP requests.
Out of Scope Changes check ✅ Passed The change is narrowly focused on replacing one hardcoded timeout with DEFAULT_TIMEOUT in the Google Jobs fetch call, directly aligned with issue #58 requirements.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

[Beginner]: Add timeout as a parameter to fetch functions

2 participants