fix(config): add mtime-based caching, fix scraper_timeout default - #233
fix(config): add mtime-based caching, fix scraper_timeout default#233tatenda-source wants to merge 2 commits into
Conversation
Closes FujiwaraChoki#224 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8262002234
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """ | ||
| with open(os.path.join(ROOT_DIR, "config.json"), "r") as file: | ||
| return json.load(file)["scraper_timeout"] or 300 | ||
| return _load_config().get("scraper_timeout", 300) or 300 |
There was a problem hiding this comment.
Preserve explicit zero scraper timeout
get_scraper_timeout() still coerces a configured 0 to 300 because the new expression keeps or 300. In environments where config.json intentionally sets scraper_timeout to 0, the runtime will continue using 300 seconds instead of the configured value, so the stated fix for falsy-zero behavior is not actually applied.
Useful? React with 👍 / 👎.
Use `is not None` check instead of `or 300` so that a configured value of 0 is respected rather than coerced to 300. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc34dd7f84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| with open(os.path.join(ROOT_DIR, "config.json"), "r") as file: | ||
| return json.load(file)["scraper_timeout"] or 300 | ||
| timeout = _load_config().get("scraper_timeout") | ||
| return timeout if timeout is not None else 300 |
There was a problem hiding this comment.
Preserve default for blank scraper timeout values
This change now returns any non-None scraper_timeout value directly, so a config value like "" (or other non-numeric placeholders users may leave while editing) no longer falls back to 300 and instead propagates to Outreach.run_scraper_with_args_for_30_seconds, where float(timeout) raises a ValueError. Before this commit, falsy placeholders were coerced to the safe default via or 300, so this introduces a runtime regression for previously tolerated configs.
Useful? React with 👍 / 👎.
Summary
get_scraper_timeout()treating valid0as falsyCloses #224
Test plan
🤖 Generated with Claude Code