File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,14 @@ class MappedMessage:
2020
2121 data : str = ""
2222 topic : str = ""
23- time : str = datetime .now (timezone .utc ).isoformat ()
2423
2524 def serialize (self ):
2625 """Serialize message adding time if not present"""
2726 if "/cmd/" in self .topic :
2827 return self .data
2928 out = json .loads (self .data )
3029 if "time" not in out :
31- out ["time" ] = self . time
30+ out ["time" ] = datetime . now ( timezone . utc ). isoformat ()
3231 return json .dumps (out )
3332
3433 def extend_data (self , other_message ):
@@ -52,7 +51,7 @@ def merge(d1: dict, d2: dict) -> dict:
5251 merged = merge (d1 , d2 )
5352
5453 if "time" not in merged :
55- merged ["time" ] = self . time
54+ merged ["time" ] = datetime . now ( timezone . utc ). isoformat ()
5655
5756 # Convert the merged dictionary back to a JSON string and update self.data
5857 self .data = json .dumps (merged )
You can’t perform that action at this time.
0 commit comments