diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-11-10 15:31:37 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-11-17 22:12:13 +0100 |
commit | 12ccf0c4f835cee1e942e13482322b0d9a5e7c2d (patch) | |
tree | dbb34fbaabcc0e9fcc8c6d42e83b32ef6867118a /lib/mix | |
parent | 4634d99d0d43c0a13fdca6ebc722c400facafa3d (diff) | |
download | pleroma-12ccf0c4f835cee1e942e13482322b0d9a5e7c2d.tar.gz |
Change Relay from `status` to `{status, message}`
Diffstat (limited to 'lib/mix')
-rw-r--r-- | lib/mix/tasks/relay_follow.ex | 6 | ||||
-rw-r--r-- | lib/mix/tasks/relay_unfollow.ex | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/mix/tasks/relay_follow.ex b/lib/mix/tasks/relay_follow.ex index 39cecb71b..bec63af7c 100644 --- a/lib/mix/tasks/relay_follow.ex +++ b/lib/mix/tasks/relay_follow.ex @@ -14,11 +14,13 @@ defmodule Mix.Tasks.RelayFollow do def run([target]) do Mix.Task.run("app.start") - with :ok <- Relay.follow(target) do + {status, message} = Relay.follow(target) + + if :ok == status do # put this task to sleep to allow the genserver to push out the messages :timer.sleep(500) else - e -> Mix.puts("Error: #{inspect(e)}") + Mix.puts("Error: #{inspect(message)}") end end end diff --git a/lib/mix/tasks/relay_unfollow.ex b/lib/mix/tasks/relay_unfollow.ex index 5f12bd9ea..df719af2b 100644 --- a/lib/mix/tasks/relay_unfollow.ex +++ b/lib/mix/tasks/relay_unfollow.ex @@ -13,11 +13,13 @@ defmodule Mix.Tasks.RelayUnfollow do def run([target]) do Mix.Task.run("app.start") - with :ok <- Relay.unfollow(target) do + {status, message} = Relay.unfollow(target) + + if :ok == status do # put this task to sleep to allow the genserver to push out the messages :timer.sleep(500) else - e -> Mix.puts("Error: #{inspect(e)}") + Mix.puts("Error: #{inspect(message)}") end end end |