Update 'src/pubsub/pubsub/pubsub_library_v4.py'

Added has_msg request to only start counting once the publishing has started
This commit is contained in:
Christopher Herr 2023-05-08 20:27:54 +02:00
parent 95276b75da
commit 61ebd7ca68
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ class MinimalSubscriber(Node):
ture = timer_overflow >> error
false = no timer_overflow >> no error"""
self.overflow = False
if time_limit > 0:
if time_limit > 0 and self.has_msg():
if time.time() > self.last_msg_time + time_limit:
self.watchdog += 1
self.trust = 0