From 313e9e78b63e94aa88935da7f502b4a44bb9d749 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Thu, 28 Sep 2023 13:46:04 +0800 Subject: [PATCH 1/2] refactor(runloop): use utils.get_updated_monotonic_ms() --- kong/runloop/handler.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kong/runloop/handler.lua b/kong/runloop/handler.lua index bdaed6a8fde..f06a9ffa201 100644 --- a/kong/runloop/handler.lua +++ b/kong/runloop/handler.lua @@ -609,7 +609,7 @@ end local reconfigure_handler do - local cur_msec = require("resty.core.time").monotonic_msec + local get_monotonic_ms = utils.get_updated_monotonic_ms local update_time = ngx.update_time local ngx_worker_id = ngx.worker.id @@ -622,11 +622,6 @@ do local CURRENT_PLUGINS_HASH = 0 local CURRENT_BALANCER_HASH = 0 - local function get_monotonic_ms() - update_time() - return cur_msec() - end - reconfigure_handler = function(data) local worker_id = ngx_worker_id() From bd952ce5cc629e4b09b6d5f9168441fb72262ee2 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Thu, 28 Sep 2023 13:51:30 +0800 Subject: [PATCH 2/2] lint fix --- kong/runloop/handler.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/kong/runloop/handler.lua b/kong/runloop/handler.lua index f06a9ffa201..98c8792e8ac 100644 --- a/kong/runloop/handler.lua +++ b/kong/runloop/handler.lua @@ -611,7 +611,6 @@ local reconfigure_handler do local get_monotonic_ms = utils.get_updated_monotonic_ms - local update_time = ngx.update_time local ngx_worker_id = ngx.worker.id local exiting = ngx.worker.exiting