From 6e04bf66babdf8403c9f6ba335291b8ac755edb4 Mon Sep 17 00:00:00 2001 From: Antonio Parisi Date: Wed, 29 Apr 2020 14:56:37 +0100 Subject: [PATCH] Configurable request timeout --- lib/shopify/config.ex | 2 ++ lib/shopify/request.ex | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/shopify/config.ex b/lib/shopify/config.ex index c4f58a2..09b4dc7 100644 --- a/lib/shopify/config.ex +++ b/lib/shopify/config.ex @@ -13,6 +13,8 @@ defmodule Shopify.Config do def password, do: get(:password) + def request_timeout, do: get(:request_timeout) + def version, do: Mix.Project.config()[:version] def fixtures_path do diff --git a/lib/shopify/request.ex b/lib/shopify/request.ex index 01d95fc..22103de 100644 --- a/lib/shopify/request.ex +++ b/lib/shopify/request.ex @@ -13,7 +13,7 @@ defmodule Shopify.Request do @headers [ "Content-Type": "application/json", - "Keep-Alive": "timeout=15, max=100", + "Keep-Alive": "timeout=#{Shopify.Config.request_timeout()}, max=100", "user-agent": "ShopifyElixir/#{Shopify.Config.version()}" ]