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 end
defp run do defp run do
:timer.sleep(:timer.seconds(60))
now = DateTime.utc_now() |> DateTime.truncate(:second) now = DateTime.utc_now() |> DateTime.truncate(:second)
@api_online @api_online
|> Philomena.Http.get!() |> Philomena.Http.get!()
|> handle_response(now) |> handle_response(now)
:timer.sleep(:timer.seconds(60))
run() run()
end end

View file

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