From 02daf21d786c8823efcfeec37420f6b3a1790335 Mon Sep 17 00:00:00 2001 From: Alex S Date: Fri, 9 Aug 2019 12:24:43 +0300 Subject: [PATCH] possibility to set tesla adapter in runtime --- lib/pleroma/http/connection.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/http/connection.ex b/lib/pleroma/http/connection.ex index 4ebe16e18..ff03a3ee3 100644 --- a/lib/pleroma/http/connection.ex +++ b/lib/pleroma/http/connection.ex @@ -12,7 +12,6 @@ defmodule Pleroma.HTTP.Connection do protocols: [:http], timeout: 20_000 ] - @adapter Application.get_env(:tesla, :adapter) @doc """ Configure a client connection @@ -24,7 +23,8 @@ defmodule Pleroma.HTTP.Connection do @spec new(Keyword.t()) :: Tesla.Env.client() def new(opts \\ []) do middleware = [Tesla.Middleware.FollowRedirects] - Tesla.client(middleware, {@adapter, options(opts)}) + adapter = Application.get_env(:tesla, :adapter) + Tesla.client(middleware, {adapter, options(opts)}) end # fetch http options