aboutsummaryrefslogtreecommitdiffstats
path: root/generate-json.lua
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2017-12-11 09:08:39 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2017-12-11 09:08:39 +0000
commitcedc084bb831f21325da66f36cefafcb8b4dfed3 (patch)
treee94cfe2b03e5a09ae49de39e3d5d107a24885f15 /generate-json.lua
parentc41aa90a9e95358e83e722c2aed42316a980e988 (diff)
downloadalpine-mirror-status-cedc084bb831f21325da66f36cefafcb8b4dfed3.tar.bz2
alpine-mirror-status-cedc084bb831f21325da66f36cefafcb8b4dfed3.tar.xz
only close steam if succesful
seems the result can be nil string or table flush: Operation timed out
Diffstat (limited to 'generate-json.lua')
-rwxr-xr-xgenerate-json.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/generate-json.lua b/generate-json.lua
index 5b5cd74..e2febf6 100755
--- a/generate-json.lua
+++ b/generate-json.lua
@@ -58,7 +58,7 @@ function get_index_status(uri)
local res = {}
local status, modified
local headers, stream = request.new_from_uri(uri):go(conf.http_timeout)
- if stream then stream:shutdown() end
+ if type(stream) == "table" then stream:shutdown() end
if headers then
status = headers:get(":status")
else