Add task to refresh an instance relay

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-10-21 11:02:28 +02:00
parent d0529a503d
commit e29704a928
2 changed files with 23 additions and 1 deletions

View File

@@ -65,4 +65,17 @@ defmodule Mix.Tasks.Mobilizon.Relay do
IO.puts(:stderr, "Error while accept #{target} follow: #{inspect(e)}")
end
end
def run(["refresh", target]) do
Common.start_mobilizon()
IO.puts("Refreshing #{target}, this can take a while.")
case Relay.refresh(target) do
:ok ->
IO.puts("Refreshed #{target}")
err ->
IO.puts(:stderr, "Error while refreshing #{target}: #{inspect(err)}")
end
end
end