pub(crate) async fn fetch_and_store(
client: &Client,
pool: &PgPool,
) -> Result<usize, FetchError>Expand description
Fetches the Pi-Star host file and upserts all reflectors into Postgres.
Returns the number of reflectors successfully upserted. Reflectors with unrecognised protocol types are skipped with a debug log.
§Errors
FetchError::Httpif the HTTP request fails or returns a non-2xx status.FetchError::Databaseif any database upsert fails. Note: a database error on one row aborts the entire batch (fail-fast) — this is acceptable because the next poll cycle will retry the full set.