From 039b23958c2913ffabb3cbf07742440efcc2eac3 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Fri, 28 Feb 2020 16:38:17 +0300 Subject: [PATCH] Fix to reduce the rate to prenent 503 error --- bin/manipulate-language | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/manipulate-language b/bin/manipulate-language index cf09034ab..b2eec6a1b 100755 --- a/bin/manipulate-language +++ b/bin/manipulate-language @@ -424,6 +424,9 @@ sub translate # Replace language code to match what translator expects $target =~ s/_/-/; + # Prevent service unavailable error + sleep 1; + my $tr; my $rsp = "https://translation.googleapis.com/language/translate/v2?q=@{[urlize($value)]}"; my $rsh = { 'Authorization' => "Bearer \"@{[trim($token)]}\"",