From 02048c3265e2002f327a2b0e285eed2df28b6430 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 10 Mar 2023 13:19:58 +0800 Subject: [PATCH] Update webstats_common.lua --- plugins/webstats/lua/webstats_common.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index 01110a371..dbc9383e0 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -528,10 +528,8 @@ function _M.store_logs_line(self, db, stmt, input_sn, info) local request_headers = logline["request_headers"] local excluded = logline["excluded"] - -- self:D("json:"..json.encode(logline)) local time_key = logline["time_key"] if not excluded then - stmt:bind_names { time=time, ip=ip, @@ -553,13 +551,16 @@ function _M.store_logs_line(self, db, stmt, input_sn, info) local res, err = stmt:step() if tostring(res) == "5" then + self:D("json:"..json.encode(logline)) self:D("step res:"..tostring(res) ..",step err:"..tostring(err)) self:D("the step database connection is busy, so it will be stored later.") + if stmt then + stmt:reset() + end return false end stmt:reset() end - return true end