From a2eddcdfcd87976866f797b5ad2b795495d2e620 Mon Sep 17 00:00:00 2001 From: Chris Bruce Date: Sat, 19 Sep 2020 01:08:15 -0700 Subject: Add widget timeouts --- weather-widget/weather.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'weather-widget') diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua index ba5b4f3..3d3b8e0 100644 --- a/weather-widget/weather.lua +++ b/weather-widget/weather.lua @@ -137,6 +137,7 @@ local function worker(args) local show_daily_forecast = args.show_daily_forecast local icon_pack_name = args.icons or 'weather-underground-icons' local icons_extension = args.icons_extension or '.png' + local timeout = args.timeout or 120 local owm_one_cal_api = ('https://api.openweathermap.org/data/2.5/onecall' .. @@ -457,7 +458,7 @@ local function worker(args) watch( string.format(GET_FORECAST_CMD, owm_one_cal_api), - 120, -- API limit is 1k req/day; day has 1440 min; every 2 min is good + timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good update_widget, weather_widget ) -- cgit v1.2.3