|
@@ -1,6 +1,7 @@
|
|
|
from hub import methods, Global
|
|
|
|
|
|
import threading
|
|
|
+import traceback
|
|
|
import time
|
|
|
import json
|
|
|
import os
|
|
@@ -30,12 +31,20 @@ def method_v001(client, userdata, message):
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+ try:
|
|
|
+ log_dict = json.loads(message.payload)
|
|
|
+ log_time = int(log_dict.get('timestamp')) / 1000
|
|
|
+ user_uuid = log_dict.get('userID')
|
|
|
+ vehicle_id = log_dict.get('VehicleID')
|
|
|
+ cockpit_id = log_dict.get('cockpitID')
|
|
|
+ except Exception as exception:
|
|
|
+ methods.debug_log("method_v001|41", f"#message.payload: {message.payload}")
|
|
|
+ methods.debug_log("method_v001|41", f"#exception: {exception.__class__.__name__}")
|
|
|
+ methods.debug_log("method_v001|41", f"#traceback: {traceback.format_exc()}")
|
|
|
+ return
|
|
|
+
|
|
|
|
|
|
- log_dict = json.loads(message.payload)
|
|
|
- log_time = int(log_dict.get('timestamp')) / 1000
|
|
|
- user_uuid = log_dict.get('userID')
|
|
|
- vehicle_id = log_dict.get('VehicleID')
|
|
|
- cockpit_id = log_dict.get('cockpitID')
|
|
|
log_uuid = UserWorkRecord.get_log_uuid(user_uuid, log_time, vehicle_id, cockpit_id)
|
|
|
log_list = [
|
|
|
|