This time update GT API token properly

This commit is contained in:
Ilia Rostovtsev
2020-02-28 21:43:17 +03:00
parent 38cc53cc71
commit 27dde7c488

View File

@@ -431,7 +431,7 @@ sub translate
my ($data, $source, $target, $value) = @_;
# Updating Google Translate API token to avoid expiration
if (((time() - $data->{'start_time'}) * 60) / 15) {
if (((time() - $data->{'start_time'}) / 60) > 15) {
say CYAN, "Updating Google Translate API token..", RESET;
$data->{'token'} = get_google_translate_token();
}