From 07d3d51705ee0084cbc318125a2ac07bd9a72f8d Mon Sep 17 00:00:00 2001 From: cn Date: Wed, 1 Mar 2017 23:31:25 +0100 Subject: [PATCH] Fix loop --- metrics_graphite.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics_graphite.lua b/metrics_graphite.lua index c8e3ead..c1b3737 100644 --- a/metrics_graphite.lua +++ b/metrics_graphite.lua @@ -87,7 +87,7 @@ function MetricsGraphite:worker() -- then do the work which might incur delays -- submit the metrics to each configured carbon host - for i,carbon_host in this.carbon_hosts do + for i,carbon_host in ipairs(this.carbon_hosts) do local sock, err = ngx.socket.tcp() if err then ngx.log(ngx.ERR, "nginx-metrics-graphite callback failed to create carbon host #" .. i .. " socket: ", err)