summaryrefslogtreecommitdiff
path: root/src/daq
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-10-19 00:42:49 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-10-19 00:42:49 +0200
commit71ca67ca1aa99493d436c8a167bcfabe1eac2053 (patch)
tree13fcc60a955fa81140db2f3bb153363162d66230 /src/daq
parentdaq: nginx lua aggregated files into one (diff)
fixed fetch error handling
Diffstat (limited to 'src/daq')
-rw-r--r--src/daq/nginx-lua/s5-nginx.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/daq/nginx-lua/s5-nginx.lua b/src/daq/nginx-lua/s5-nginx.lua
index 475a576..13925c5 100644
--- a/src/daq/nginx-lua/s5-nginx.lua
+++ b/src/daq/nginx-lua/s5-nginx.lua
@@ -123,7 +123,8 @@ function _SFIVE.fetch()
local ok, err = ngx.say(sfive_data:get(k))
if not ok then
ngx.log(ngx.ERR, "SFive(fetch): failed to send data set: ", err)
- break
+ lock:unlock("fetch")
+ return
end
sfive_data:delete(k)
end
@@ -141,10 +142,7 @@ function _SFIVE.fetch()
end
ngx.sleep(0.1)
end
- ok, err = lock:unlock("fetch")
- if not ok then
- ngx.log(ngx.ERR, "SFive(fetch): unlock error: " .. err)
- end
+ lock:unlock("fetch")
end
end