Repository navigation
Crawler: one schedule table for which languages run, when, and how much - #788
Merged
Merged
Conversation
…CRAWLED crawl.py kept its own hardcoded ALL_LANGUAGES, which lacked bg, so every Bulgarian crawl exited with 'Invalid language codes: [bg]'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zeeguu/core/crawl_schedule.py now holds every crawled language with its crawl hours and limits. Language.CODES_OF_LANGUAGES_BEING_CRAWLED and crawl.py's valid-language check derive from it, and crawl_all_in_parallel.sh asks it which languages are due (cron will call it once an hour with no language args; see the matching ops PR). Before this, a language had to be added in the crontab, the shell script's LANG_CONFIG/DEFAULT_LANGUAGES, crawl.py's ALL_LANGUAGES, and Language -- Bulgarian needed three separate fixes to go live. - The 3x-a-day slot moves from 10:06/14:50/20:50 to the :37 run at 9/14/20h, after the hourly da/fr/de. 9 rather than 10 so the morning crawl still finishes before the 11:00 feed_delivery_health check. - sv stays offered in the app but is PAUSED (never due), as today. - Removes stale copies with their own language lists: tools/crawler/crawl.py, tools/crawler/crawl_roundrobin.py, two_anthropic_crawl.sh, crawl_ab_test.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ArchLens - No architecturally relevant changes to the existing views |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Bulgarian took three fixes to go live, because the list of crawled languages was defined in several places that each rejected
bgin their own way:LANG_CONFIG_*/DEFAULT_LANGUAGESincrawl_all_in_parallel.sh(silently skippedbg)ALL_LANGUAGESincrawl.py(exited with "Invalid language codes: ['bg']")Language.CODES_OF_LANGUAGES_BEING_CRAWLEDWhat
zeeguu/core/crawl_schedule.py:CRAWL_SCHEDULElists every crawled language with its crawl hours,max_articlesandmax_minutes. It uses only the standard library, so the shell script runs it with the host'spython3and it reads the same clock cron uses.Language.CODES_OF_LANGUAGES_BEING_CRAWLED = list(CRAWL_SCHEDULE)crawl.py's valid-language check uses that list.crawl_all_in_parallel.shasks the schedule which languages are due this hour (or looks up the limits for languages passed explicitly). TheLANG_CONFIGblock is gone.feed_delivery_healthcheck.svisPAUSED: still offered in the app, never due. That's the same as today.tools/crawler/crawl.py,tools/crawler/crawl_roundrobin.py,two_anthropic_crawl.sh,crawl_ab_test.sh.Adding a language is now one line in
CRAWL_SCHEDULE, plus its feeds.Deploy order
cd ~/ops/cron && ./refresh. Doing it the other way round would crawl pt sv ro nl en el es it every hour until this is deployed.Testing
zeeguu/core/test/test_crawl_schedule.py. I couldn't run it locally (the local venv is empty and there's no Docker), so CI is its first run.crawl_all_in_parallel.shend to end with stubdocker/timeout. At 9h it launches the same 11crawl.pycommands, with the same--max-articles/--max-time, that the old crontab andLANG_CONFIGproduced (plusbg). The</dev/nullguard is needed: without it, adocker compose runthat reads stdin swallows the rest of the plan and only the first language runs.🤖 Generated with Claude Code