fetch_and_store

Function fetch_and_store 

Source
pub(crate) async fn fetch_and_store(
    client: &Client,
    pool: &PgPool,
) -> Result<usize, FetchError>
Expand description

Fetches the ircDDB last-heard page and inserts activity observations.

Returns the number of observations successfully inserted. Rows that cannot be parsed (missing columns, empty callsign, unrecognisable reflector) are skipped with a debug log rather than failing the entire scrape.

§Errors

§HTML parsing notes

The scraper is written against the expected standard <table>/<tr>/<td> structure. If the ircDDB site changes its layout, this function will return 0 observations (not an error) and log a warning — the data simply becomes stale until the scraper is updated.