# HG changeset patch # User Kim Alvefur # Date 1637445051 -3600 # Node ID 4d63d8ef1cf9d71b35c99e13efe80fffcfefb669 # Parent 99444bf26a3d5c129abe695ffafdd0abb67caa52 mod_csi_simple: Early return on client activity while flushing buffer Cuts down on log and measurement noise. We only want to do these things here when initiating a flush. diff -r 99444bf26a3d -r 4d63d8ef1cf9 plugins/mod_csi_simple.lua --- a/plugins/mod_csi_simple.lua Sat Nov 20 19:23:08 2021 +0100 +++ b/plugins/mod_csi_simple.lua Sat Nov 20 22:50:51 2021 +0100 @@ -143,7 +143,7 @@ local function flush_buffer(data, session) local ctr = session.csi_counter or 0; - if ctr == 0 then return data end + if ctr == 0 or session.state == "flushing" then return data end session.log("debug", "Flushing buffer (%s; queue size is %d)", "client activity", session.csi_counter); session.state = "flushing"; module:fire_event("csi-flushing", { session = session });