summaryrefslogtreecommitdiff
path: root/lib/lsg/icecast.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2018-02-17 21:21:42 +0100
committerhref <href@random.sh>2018-02-17 21:21:42 +0100
commit50c6a09ff64cb081b27a0c30790b86873449d172 (patch)
treeba1bebfc7e367f169276692e0ac02709d62d6516 /lib/lsg/icecast.ex
parenttxt: fix against malicious filenames (aka 'fuck you shiv') (diff)
:)
Diffstat (limited to '')
-rw-r--r--lib/lsg/icecast.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/lsg/icecast.ex b/lib/lsg/icecast.ex
index 21a9ea2..07dd4fc 100644
--- a/lib/lsg/icecast.ex
+++ b/lib/lsg/icecast.ex
@@ -1,7 +1,6 @@
defmodule LSG.Icecast do
use GenServer
require Logger
- @interval 2_500
@hackney_pool :default
@httpoison_opts [hackney: [pool: @hackney_pool]]
@fuse __MODULE__
@@ -42,7 +41,8 @@ defmodule LSG.Icecast do
Logger.error "Icecast HTTP Error: #{inspect error}"
state
end
- :timer.send_after(@interval, :poll)
+ interval = Application.get_env(:lsg, :icecast_poll_interval, 60_000)
+ :timer.send_after(interval, :poll)
state
end
@@ -83,7 +83,7 @@ defmodule LSG.Icecast do
end
defp request(uri, method, body \\ [], headers \\ []) do
- headers = [{"user-agent", "LSG-API[lsg.goulag.org] href@random.sh"}] ++ headers
+ headers = [{"user-agent", "LSG-API[115ans.net, sys.115ans.net] href@random.sh"}] ++ headers
options = @httpoison_opts
case :ok do #:fuse.ask(@fuse, :sync) do
:ok -> run_request(method, uri, body, headers, options)