sleep first, then request

This commit is contained in:
byte[] 2019-12-19 23:14:14 -05:00
parent e0e0d3c84d
commit e33be9c8de
2 changed files with 4 additions and 2 deletions

View file

@ -17,13 +17,14 @@ defmodule Philomena.Servers.PicartoChannelUpdater do
end
defp run do
:timer.sleep(:timer.seconds(60))
now = DateTime.utc_now() |> DateTime.truncate(:second)
@api_online
|> Philomena.Http.get!()
|> handle_response(now)
:timer.sleep(:timer.seconds(60))
run()
end

View file

@ -17,13 +17,14 @@ defmodule Philomena.Servers.PiczelChannelUpdater do
end
defp run do
:timer.sleep(:timer.seconds(60))
now = DateTime.utc_now() |> DateTime.truncate(:second)
@api_online
|> Philomena.Http.get!()
|> handle_response(now)
:timer.sleep(:timer.seconds(60))
run()
end