Change Relay from status to {status, message}
This commit is contained in:
parent
4634d99d0d
commit
12ccf0c4f8
4 changed files with 14 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue