diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index 5f1275fef..3571f9c18 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -353,12 +353,14 @@ function _M.cron(self) local db = dbs[input_sn] local stat_fields_is = stat_fields[input_sn] if not db then + ngx.shared.mw_total:rpush(total_key, data) self:unlock_working(cron_key) break end local insert_ok = self:store_logs_line(db, stmts[input_sn]["web_logs"], input_sn, info) if not insert_ok then + ngx.shared.mw_total:rpush(total_key, data) self:unlock_working(cron_key) break end diff --git a/plugins/webstats/lua/webstats_log.lua b/plugins/webstats/lua/webstats_log.lua index 59e928e08..d1f1bfdce 100644 --- a/plugins/webstats/lua/webstats_log.lua +++ b/plugins/webstats/lua/webstats_log.lua @@ -442,7 +442,7 @@ log_by_lua_block { local push_data = json.encode(data) -- C:D(json.encode(push_data)) local key = C:getTotalKey() - ngx.shared.mw_total:rpush(key, push_data) + ngx.shared.mw_total:rpush(key, push_data) end local function store_logs_line(db, stmt, input_server_name, lineno)