We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7bcb4f3 commit 24221e6Copy full SHA for 24221e6
testgres/logger.py
@@ -25,15 +25,20 @@ def run(self):
25
with open(self._log_file_name, 'r') as fd:
26
# work until we're asked to stop
27
while not self._stop_event.is_set():
28
+ sleep_time = 0.1
29
+ new_lines = False
30
+
31
# do we have new lines?
32
if fd in select.select([fd], [], [], 0)[0]:
33
for line in fd.readlines():
34
line = line.strip()
35
if line:
36
+ new_lines = True
37
extra = {'node': self._node_name}
38
self._logger.info(line, extra=extra)
- else:
- time.sleep(0.1)
39
40
+ if not new_lines:
41
+ time.sleep(sleep_time)
42
43
# don't forget to clear event
44
self._stop_event.clear()
0 commit comments