Fetch a new token if os update gets a 404
parent
8d938a0754
commit
5552c68fa3
|
@ -82,7 +82,6 @@ defmodule Farmbot.System.Updates do
|
|||
|
||||
end
|
||||
|
||||
|
||||
if should_apply_update(@env, prerelease, needs_update) do
|
||||
Logger.busy 1, "Downloading FarmbotOS over the air update"
|
||||
IO.puts cl
|
||||
|
@ -103,6 +102,10 @@ defmodule Farmbot.System.Updates do
|
|||
{:error, reason} ->
|
||||
Logger.error 1, "Failed to fetch update data: #{inspect reason}"
|
||||
|
||||
{:ok, %{status_code: 400}} ->
|
||||
Logger.info 2, "Had out of date token. Try that again."
|
||||
Farmbot.Bootstrap.AuthTask.force_refresh()
|
||||
|
||||
{:ok, %{body: body, status_code: code}} ->
|
||||
reason = case Poison.decode(body) do
|
||||
{:ok, res} -> res
|
||||
|
|
Loading…
Reference in New Issue