From 500455481fd77f7776121a9f09015b9f845d0d94 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sat, 1 Mar 2025 07:25:05 +0000 Subject: [PATCH] Set the LastFm http client to terminate idle connections after 30 secs This change attempts at solving the issue of the application being woken up after suspension and being unable to talk to the LastFm API (i.e. throwing plenty of Mint/timeout errors). The theory is that with this setting the application should quickly enough restart the pool after waking up. --- lib/last_fm/api.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/last_fm/api.ex b/lib/last_fm/api.ex index b56eb1af..d2eef0cb 100644 --- a/lib/last_fm/api.ex +++ b/lib/last_fm/api.ex @@ -95,6 +95,7 @@ defmodule LastFm.API do connect_options: [ timeout: 2500 ], + pool_max_idle_time: 30_000, user_agent: config.user_agent ) |> Req.Request.merge_options(config.req_options)