Skip to content
Snippets Groups Projects
Commit a82bcd0e authored by Peter Nerlich's avatar Peter Nerlich
Browse files

add fetch timeout setting, increase default to 30 seconds

parent 89ae7ecd
Branches master
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
local FETCH_INTERVAL = tonumber(minetest.settings:get("ak_announcer.fetch_interval")) or 4*60
local FETCH_TIMEOUT = tonumber(minetest.settings:get("ak_announcer.fetch_timeout")) or 30
local aka = ak_announcer
aka.my_offset = 0
......@@ -149,7 +150,7 @@ function aka.fetch_data(name, cb)
http.fetch({
url = url .. api .. "/?format=json",
timeout = 5
timeout = FETCH_TIMEOUT
}, function(res)
local value = minetest.parse_json(res.data)
local new_data = {}
......
local API = minetest.settings:get("ak_announcer.api_endpoint") or "http://ak.kif.rocks/kif490/api/"
local FETCH_INTERVAL = tonumber(minetest.settings:get("ak_announcer.fetch_interval")) or 4*60
local FETCH_TIMEOUT = tonumber(minetest.settings:get("ak_announcer.fetch_timeout")) or 30
if API:sub(-1) ~= "/" then
API = API.."/"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment