IemClient.fetch_asos returns 24-288 rows per station per call, each previously triggering an individual UPDATE-conflict round-trip via Weather.upsert_surface_observation/2. On the Turing Pi 2 Postgres node that per-row latency dominates ingestion time. Add Weather.upsert_surface_observations/2, a bulk variant that collapses the rows into a single Repo.insert_all with the same update-only-when-changed on_conflict predicate and (station_id, observed_at) conflict target. Switch WeatherFetchWorker to use it. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| microwaveprop | ||
| microwaveprop_web | ||
| mix/tasks | ||
| support | ||
| test_helper.exs | ||