summaryrefslogtreecommitdiff
path: root/weather-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2020-02-14 08:29:35 -0500
committerGitHub <noreply@github.com>2020-02-14 08:29:35 -0500
commit2a06d64a519fea132e4d47bafefacacc932f7b6d (patch)
treef553f1a66761482f4ed552e686b03fd674c80fed /weather-widget
parenta9a588e7f3ef58e23a06f523c059996ac8aedd9a (diff)
parentefc2131442921921a4e10b6c756b271d4ade84d8 (diff)
Merge pull request #111 from utix/weather_retry
[Weather] Add delay between retry
Diffstat (limited to 'weather-widget')
-rw-r--r--weather-widget/weather.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua
index a1075f6..6fafa97 100644
--- a/weather-widget/weather.lua
+++ b/weather-widget/weather.lua
@@ -144,6 +144,8 @@ local function worker(args)
end
local function error_display(resp_json)
+ weather_timer.timeout = math.min(15 * 60, weather_timer.timeout * 2)
+ weather_timer:again()
local err_resp = json.decode(resp_json)
naughty.notify{
title = 'Weather Widget Error',
@@ -185,6 +187,8 @@ local function worker(args)
resp = json.decode(resp_json)
icon_widget.image = path_to_icons .. icon_map[resp.weather[1].icon]
temp_widget:set_text(gen_temperature_str(resp.main.temp, '%.0f', both_units_widget))
+ weather_timer.timeout = 60
+ weather_timer:again()
end
end)
weather_timer:start()