Save some space

This commit is contained in:
Itay Mizeretz 2018-02-14 16:58:58 +02:00
parent 86a0e47d15
commit 70766e7358
1 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,8 @@ class Log(flask_restful.Resource):
telemetry_json = json.loads(request.data) telemetry_json = json.loads(request.data)
monkey_id = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])['_id'] monkey_id = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])['_id']
log_id = LogService.add_log(monkey_id, telemetry_json['log']) # This is base64 so no data will be lost. this'll take 2 time less space.
log_data = str(telemetry_json['log'])
log_id = LogService.add_log(monkey_id, log_data)
return mongo.db.log.find_one_or_404({"_id": log_id}) return mongo.db.log.find_one_or_404({"_id": log_id})