Skip to content
Snippets Groups Projects
Commit 670c5e49 authored by ddamiron's avatar ddamiron
Browse files

add progress_ratio tag in log_message

parent 670d9115
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,7 @@ class MongoSession: ...@@ -44,6 +44,7 @@ class MongoSession:
print('body session_id: ', body_object['session_id']) print('body session_id: ', body_object['session_id'])
timestamp = datetime.datetime.strptime(body_object["timestamp"], "%Y-%m-%dT%H:%M:%S.%fZ") timestamp = datetime.datetime.strptime(body_object["timestamp"], "%Y-%m-%dT%H:%M:%S.%fZ")
float_progress_ratio = float(body_object["progress_ratio"])
self.mongo_data_collection.insert_one({"session_id": body_object["session_id"], self.mongo_data_collection.insert_one({"session_id": body_object["session_id"],
"timestamp": timestamp, "timestamp": timestamp,
...@@ -52,7 +53,7 @@ class MongoSession: ...@@ -52,7 +53,7 @@ class MongoSession:
"status": body_object["status"], "status": body_object["status"],
"uuid_prefix": body_object["uuid_prefix"], "uuid_prefix": body_object["uuid_prefix"],
"info": body_object["info"], "info": body_object["info"],
"progress_ratio": body_object["progress_ratio"], "progress_ratio": float_progress_ratio,
"loglevel": body_object["loglevel"]}) "loglevel": body_object["loglevel"]})
except Exception as exc: except Exception as exc:
print('[ERROR saving log]:', exc) print('[ERROR saving log]:', exc)
......
...@@ -234,7 +234,7 @@ def on_msg_callback(channel, method, properties, body): ...@@ -234,7 +234,7 @@ def on_msg_callback(channel, method, properties, body):
uuid_prefix='full', uuid_prefix='full',
info=uuid, info=uuid,
loglevel='ERROR', loglevel='ERROR',
progress_ratio=None progress_ratio=1
) )
json_body = json.dumps(log_message.__dict__) json_body = json.dumps(log_message.__dict__)
...@@ -307,7 +307,7 @@ def on_msg_callback(channel, method, properties, body): ...@@ -307,7 +307,7 @@ def on_msg_callback(channel, method, properties, body):
uuid_prefix='full', uuid_prefix='full',
info=uuid, info=uuid,
loglevel='INFO', loglevel='INFO',
progress_ratio=None progress_ratio=0.4
) )
json_body = json.dumps(log_message.__dict__) json_body = json.dumps(log_message.__dict__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment