Merge pull request #4 from tcivie/bug/crash-on-parsing-from-stat
Fixed issue when exporter tried to parse messages from the stat folder
This commit is contained in:
commit
f2d02be6d2
6
main.py
6
main.py
|
@ -21,6 +21,12 @@ def handle_connect(client, userdata, flags, reason_code, properties):
|
|||
def handle_message(client, userdata, message):
|
||||
current_timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
print(f"Received message on topic '{message.topic}' at {current_timestamp}")
|
||||
|
||||
# Filter out messages from the 'stat' topic
|
||||
if '/stat/' in message.topic:
|
||||
print(f"Filtered out message from topic containing '/stat/': {message.topic}")
|
||||
return
|
||||
|
||||
envelope = ServiceEnvelope()
|
||||
envelope.ParseFromString(message.payload)
|
||||
|
||||
|
|
Loading…
Reference in a new issue