From a0c4273280df7ca1550990c130984d50f0f9b477 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 21 Nov 2023 21:59:24 +0800 Subject: [PATCH] Update webstats_common.lua --- plugins/webstats/lua/webstats_common.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index b2a07492f..255aa5c1c 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -371,7 +371,14 @@ function _M.cron(self) break end - local insert_ok = self:store_logs_line(db, stmts[input_sn]["web_logs"], input_sn, info) + local input_stmts = stmts[input_sn]["web_logs"] + if input_stmts then + ngx.shared.mw_total:rpush(total_key, data) + self:unlock_working(cron_key) + break + end + + local insert_ok = self:store_logs_line(db, input_stmts, input_sn, info) if not insert_ok then ngx.shared.mw_total:rpush(total_key, data) self:unlock_working(cron_key)