Use dedicated http client pool for LastFm
This commit is contained in:
@@ -41,7 +41,7 @@ defmodule LastFm.APIImpl do
|
|||||||
{"User-Agent", "MusicLibrary/0.1.0 ( cloud8421@gmail.com )"}
|
{"User-Agent", "MusicLibrary/0.1.0 ( cloud8421@gmail.com )"}
|
||||||
])
|
])
|
||||||
|
|
||||||
case Finch.request(req, MusicLibrary.Finch) do
|
case Finch.request(req, LastFm.Finch) do
|
||||||
{:ok, response} when response.status == 200 ->
|
{:ok, response} when response.status == 200 ->
|
||||||
Jason.decode(response.body)
|
Jason.decode(response.body)
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ defmodule LastFm.Supervisor do
|
|||||||
:ok = LastFm.Feed.create_table!()
|
:ok = LastFm.Feed.create_table!()
|
||||||
|
|
||||||
children = [
|
children = [
|
||||||
|
{Finch, name: LastFm.Finch},
|
||||||
{Phoenix.PubSub, name: LastFm.PubSub},
|
{Phoenix.PubSub, name: LastFm.PubSub},
|
||||||
{LastFm.Refresh, config}
|
{LastFm.Refresh, config}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user