We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a76cc5 commit efed20dCopy full SHA for efed20d
sentry_sdk/_log_batcher.py
@@ -13,6 +13,7 @@
13
14
class LogBatcher:
15
MAX_LOGS_BEFORE_FLUSH = 100
16
+ MAX_LOGS_BEFORE_DROP = 1_000
17
FLUSH_WAIT_TIME = 5.0
18
19
def __init__(
@@ -79,6 +80,9 @@ def add(
79
80
return None
81
82
with self._lock:
83
+ if len(self._log_buffer) >= self.MAX_LOGS_BEFORE_DROP:
84
+ return None
85
+
86
self._log_buffer.append(log)
87
if len(self._log_buffer) >= self.MAX_LOGS_BEFORE_FLUSH:
88
self._flush_event.set()
0 commit comments