Browse Source

conflicts between BS and OGN now ignored

master
squeaky otter 3 weeks ago
parent
commit
32a79adab1
Signed by: dashie GPG Key ID: C2D57B325840B755
  1. 3
      backend/lib/mix/tasks/pyairwaves/update_aircrafts_mode_s_ogn.ex

3
backend/lib/mix/tasks/pyairwaves/update_aircrafts_mode_s_ogn.ex

@ -78,11 +78,12 @@ defmodule Mix.Tasks.Pyairwaves.UpdateAircraftsModeSogn do
fn ->
# CSV Header:
# DEVICE_TYPE,DEVICE_ID,AIRCRAFT_MODEL,REGISTRATION,CN,TRACKED,IDENTIFIED
# Duplicate ICAO codes (on_conflict) will be ignored
HTTPoison.get!(url, [], []).body
|> UAMSOGNParser.parse_string(skip_headers: true)
|> Enum.map(fn row ->
{:ok, am} = parse_aircraft_mode(row)
Pyairwaves.Repo.insert!(am, log: false)
Pyairwaves.Repo.insert!(am, on_conflict: :nothing, log: false)
end)
end,
log: false,

Loading…
Cancel
Save