diff options
author | Chris Bruce <aprofessionalemailaddress@gmail.com> | 2020-09-19 01:08:15 -0700 |
---|---|---|
committer | Chris Bruce <aprofessionalemailaddress@gmail.com> | 2020-09-19 01:08:15 -0700 |
commit | a2eddcdfcd87976866f797b5ad2b795495d2e620 (patch) | |
tree | e3498520985e33915a211389951d6c0c971b972b /weather-widget | |
parent | a127ffe8efc8ccb91b7a8495c23f67278609df25 (diff) |
Add widget timeouts
Diffstat (limited to 'weather-widget')
-rw-r--r-- | weather-widget/weather.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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 ) |