Skip to content

Commit c00747f

Browse files
authored
Fix log check. (#56)
1 parent b384b20 commit c00747f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

rayvens/core/invocation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ def _check_kamel_output(self,
197197
countdown -= 1
198198
if countdown == 0:
199199
break
200-
reading_thread.read_flag.set()
200+
if output is not None:
201+
reading_thread.read_flag.set()
201202
time.sleep(0.01)
202203

203204
# Terminate log thread:

rayvens/core/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ def __init__(self, stdout):
9292
def run(self):
9393
while not self.stop_flag.is_set():
9494
if self.read_flag.is_set():
95-
line = self.stdout.readline().decode("utf-8")
96-
self.queue.put(line.strip())
97-
self.read_flag.clear()
95+
line = self.stdout.readline().decode("utf-8").strip()
96+
if line != "":
97+
self.queue.put(line)
98+
self.read_flag.clear()
9899

99100
print("[Logging thread] Kamel command logging terminated.")
100101

@@ -105,7 +106,7 @@ def print_log_from_queue(subprocess_name, queue, with_output):
105106
except Empty:
106107
return None
107108
else:
108-
if line != "" and with_output:
109+
if with_output:
109110
print(subprocess_tag(subprocess_name), line)
110111
return line
111112

0 commit comments

Comments
 (0)