Skip to content

Resolve some annoying issues in the periodic scraper#27

Open
salcock wants to merge 4 commits into
masterfrom
scraper-startup-fixes
Open

Resolve some annoying issues in the periodic scraper#27
salcock wants to merge 4 commits into
masterfrom
scraper-startup-fixes

Conversation

@salcock

@salcock salcock commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator
  • fix issue where the periodic scraper would always do a full historical scrape on start up
  • add 48 hour grace period to avoid missing files if they were uploaded out of order
  • fixed outdated arguments in the main.go query CLI

salcock added 4 commits June 26, 2026 15:40
This method scraped every RIB and UPDATE for every known collector
on startup, which is a) unnecessary, b) takes a long time and
therefore prevents scraping newer files in the meantime.

The regular scraping routines should suffice and also respect
the last_completed_crawl times in the database so won't waste
time crawling files that we already know about.
This resolves issues when updates appear on the collector site
in non-chronological order. When this happens, the last completed
crawl time is set to a timestamp after the missing updates and
therefore they are never subsequently scraped once they arrive.

Now, the scraper will look back up to 48 hours from the last
completed crawl time to ensure that it sees those missing files
on a subsequent crawl.

Note: currently our scraper attempts to upsert each file that it
scrapes so we are now going to be doing a lot of redundant updates
in the general case. Might be worth re-thinking how we want to
handle conflicts in db.go?
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