File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -131,12 +131,13 @@ function setupWeightBasedFlushing<
131131 flushFn ( client ) ;
132132 } else if ( ! isTimerActive ) {
133133 // Only start timer if one isn't already running.
134- // This prevents flushing being delayed by logs that arrive close to the timeout limit
135- // and thus resetting the flushing timeout and delaying logs being flushed.
134+ // This prevents flushing being delayed by items that arrive close to the timeout limit
135+ // and thus resetting the flushing timeout and delaying items being flushed.
136136 isTimerActive = true ;
137137 flushTimeout = setTimeout ( ( ) => {
138138 flushFn ( client ) ;
139- isTimerActive = false ;
139+ // Note: isTimerActive is reset by the flushHook handler above, not here,
140+ // to avoid race conditions when new items arrive during the flush.
140141 } , DEFAULT_FLUSH_INTERVAL ) ;
141142 }
142143 } ) ;
You can’t perform that action at this time.
0 commit comments