File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ def emit(self, record: logging.LogRecord):
9090 self .log_times .append (time .time ())
9191 except Exception :
9292 self .handleError (record )
93- pass
9493
9594 def format_record (self , record : logging .LogRecord ):
9695 """
@@ -113,8 +112,10 @@ def _worker(self):
113112 try :
114113 log_entry = self .queue .get (timeout = 0.05 )
115114 batch .append (log_entry )
115+ # If the queue is empty, check back again
116116 except Empty :
117- pass
117+ time .sleep (1 )
118+ continue
118119
119120 # Calculate logging rate based on past second
120121 now = time .time ()
@@ -146,8 +147,7 @@ def _send_batch(self, batch: list[str]):
146147 if response .status_code == 200 :
147148 return
148149 except requests .RequestException :
149- pass
150- time .sleep (2 ** (attempt + 1 ) * 0.1 ) # Exponential backoff
150+ time .sleep (2 ** (attempt + 1 ) * 0.1 ) # Exponential backoff
151151
152152 def close (self ):
153153 self ._stop_event .set ()
You can’t perform that action at this time.
0 commit comments