Skip to content

Commit a3a09a6

Browse files
add listen() message
1 parent 371b159 commit a3a09a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

functions/broker.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ def listen(self, duration, channel):
127127
time.sleep(0.25)
128128
if self.state.last_message is not None:
129129
seconds = (datetime.now() - start_time).seconds
130-
self.state.print_status(description=f"Message received after {seconds} seconds")
130+
self.state.print_status(
131+
description=f"Message received after {seconds} seconds",
132+
update_only=True)
131133
break
134+
if self.state.last_message is None:
135+
self.state.print_status(
136+
description=f"Did not receive message after {duration} seconds",
137+
update_only=True)
132138

133139
self.stop_listen()

0 commit comments

Comments
 (0)