~ihabunek/triglav

c5c0d6038a88afe6169149470c57ed167227aae4 — Ivan Habunek 10 months ago c0b5996
Update errors after importing osm data
2 files changed, 6 insertions(+), 2 deletions(-)

M lib/mix/tasks/triglav/osmosis_update.ex
M lib/triglav/import/osmosis.ex
M lib/mix/tasks/triglav/osmosis_update.ex => lib/mix/tasks/triglav/osmosis_update.ex +5 -2
@@ 1,13 1,16 @@
defmodule Mix.Tasks.Triglav.OsmosisUpdate do
  use Mix.Task

  alias Triglav.Import.Osmosis
  alias Mix.Tasks.Triglav.ValidateRoutes

  @shortdoc "Updates the osmosis data to latest available."

  @impl Mix.Task
  def run(_args) do
    Application.put_env(:triglav, :repo_only, true)
    {:ok, _} = Application.ensure_all_started(:triglav)

    Triglav.Import.Osmosis.update()
    :ok = Osmosis.update()
    {:ok, _} = ValidateRoutes.validate()
  end
end

M lib/triglav/import/osmosis.ex => lib/triglav/import/osmosis.ex +1 -0
@@ 90,6 90,7 @@ defmodule Triglav.Import.Osmosis do
      if web_state.sequence_number > local_state.sequence_number do
        Logger.info("New data available. Updating.")
        apply_updates(local_state, web_state)
        :ok
      else
        Logger.info("You already have the latest data")
        :ok