diff --git a/apisix/plugins/datadog.lua b/apisix/plugins/datadog.lua index 6a55886f..b613bac9 100644 --- a/apisix/plugins/datadog.lua +++ b/apisix/plugins/datadog.lua @@ -26,6 +26,7 @@ local format = string.format local concat = table.concat local buffers = {} local ipairs = ipairs +local pairs = pairs local tostring = tostring local stale_timer_running = false local timer_at = ngx.timer.at @@ -120,7 +121,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key)) diff --git a/apisix/plugins/google-cloud-logging.lua b/apisix/plugins/google-cloud-logging.lua index 961762d2..a233d3f5 100644 --- a/apisix/plugins/google-cloud-logging.lua +++ b/apisix/plugins/google-cloud-logging.lua @@ -18,7 +18,7 @@ local core = require("apisix.core") local ngx = ngx local tostring = tostring -local ipairs = ipairs +local pairs = pairs local ngx_timer_at = ngx.timer.at local http = require("resty.http") local log_util = require("apisix.utils.log-util") @@ -128,7 +128,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, route id:", tostring(key)) buffers[key] = nil diff --git a/apisix/plugins/http-logger.lua b/apisix/plugins/http-logger.lua index b52c1adc..a4eadb3f 100644 --- a/apisix/plugins/http-logger.lua +++ b/apisix/plugins/http-logger.lua @@ -25,6 +25,7 @@ local plugin = require("apisix.plugin") local ngx = ngx local tostring = tostring local ipairs = ipairs +local pairs = pairs local timer_at = ngx.timer.at local plugin_name = "http-logger" @@ -166,7 +167,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key)) diff --git a/apisix/plugins/kafka-logger.lua b/apisix/plugins/kafka-logger.lua index def042fe..01439225 100644 --- a/apisix/plugins/kafka-logger.lua +++ b/apisix/plugins/kafka-logger.lua @@ -23,7 +23,6 @@ local plugin = require("apisix.plugin") local math = math local pairs = pairs local type = type -local ipairs = ipairs local plugin_name = "kafka-logger" local stale_timer_running = false local timer_at = ngx.timer.at @@ -164,7 +163,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key)) diff --git a/apisix/plugins/skywalking-logger.lua b/apisix/plugins/skywalking-logger.lua index 58f25b84..bd5f9c11 100644 --- a/apisix/plugins/skywalking-logger.lua +++ b/apisix/plugins/skywalking-logger.lua @@ -28,7 +28,7 @@ local ngx_re = require("ngx.re") local ngx = ngx local tostring = tostring local tonumber = tonumber -local ipairs = ipairs +local pairs = pairs local timer_at = ngx.timer.at local plugin_name = "skywalking-logger" @@ -130,7 +130,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key)) diff --git a/apisix/plugins/sls-logger.lua b/apisix/plugins/sls-logger.lua index daeaebb7..797b85fd 100644 --- a/apisix/plugins/sls-logger.lua +++ b/apisix/plugins/sls-logger.lua @@ -26,6 +26,7 @@ local tcp = ngx.socket.tcp local buffers = {} local tostring = tostring local ipairs = ipairs +local pairs = pairs local table = table local schema = { type = "object", @@ -116,7 +117,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, route id:", tostring(key)) buffers[key] = nil diff --git a/apisix/plugins/syslog.lua b/apisix/plugins/syslog.lua index a3ec8229..3eed59ff 100644 --- a/apisix/plugins/syslog.lua +++ b/apisix/plugins/syslog.lua @@ -22,7 +22,7 @@ local logger_socket = require("resty.logger.socket") local plugin_name = "syslog" local ngx = ngx local buffers = {} -local ipairs = ipairs +local pairs = pairs local stale_timer_running = false; local timer_at = ngx.timer.at @@ -121,7 +121,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key)) diff --git a/apisix/plugins/tcp-logger.lua b/apisix/plugins/tcp-logger.lua index dc4cb212..8d678b33 100644 --- a/apisix/plugins/tcp-logger.lua +++ b/apisix/plugins/tcp-logger.lua @@ -22,7 +22,7 @@ local tostring = tostring local buffers = {} local ngx = ngx local tcp = ngx.socket.tcp -local ipairs = ipairs +local pairs = pairs local stale_timer_running = false local timer_at = ngx.timer.at @@ -106,7 +106,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key)) diff --git a/apisix/plugins/udp-logger.lua b/apisix/plugins/udp-logger.lua index 06f903e6..97e6552c 100644 --- a/apisix/plugins/udp-logger.lua +++ b/apisix/plugins/udp-logger.lua @@ -22,7 +22,7 @@ local tostring = tostring local buffers = {} local ngx = ngx local udp = ngx.socket.udp -local ipairs = ipairs +local pairs = pairs local stale_timer_running = false; local timer_at = ngx.timer.at @@ -90,7 +90,7 @@ local function remove_stale_objects(premature) return end - for key, batch in ipairs(buffers) do + for key, batch in pairs(buffers) do if #batch.entry_buffer.entries == 0 and #batch.batch_to_process == 0 then core.log.warn("removing batch processor stale object, conf: ", core.json.delay_encode(key))