From b974351d0746d92e244fc94b23d3c1ea4cf01da3 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 16 Dec 2019 16:58:17 -0500 Subject: [PATCH] up translation timeout to 15s --- lib/thirdparty/Transifex.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/thirdparty/Transifex.class.php b/lib/thirdparty/Transifex.class.php index e5cf5032..cf62356d 100644 --- a/lib/thirdparty/Transifex.class.php +++ b/lib/thirdparty/Transifex.class.php @@ -3,16 +3,18 @@ class Transifex { - public static function isConfigured() { - return (boolean)Config::get(Config::TRANSIFEX_API_KEY); + public static function isConfigured() + { + return (boolean)Config::get(Config::TRANSIFEX_API_KEY); } public static function getTranslationResourceFile($project, $resource, $language, $cache = true) { - $url = "https://www.transifex.com/api/2/project/$project/resource/$resource/translation/$language?file=1"; - return json_decode(CurlWithCache::get($url, [], [ + $url = "https://www.transifex.com/api/2/project/$project/resource/$resource/translation/$language?file=1"; + return json_decode(CurlWithCache::get($url, [], [ 'password' => 'api:' . Config::get(Config::TRANSIFEX_API_KEY), - 'cache' => $cache ? 1000 * 60 * 60 * 8 : false + 'cache' => $cache ? 1000 * 60 * 60 * 8 : false, + 'timeout' => 5 ]), true); } -} \ No newline at end of file +}