1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

Fixed list data converting

This commit is contained in:
samson0v
2024-08-15 13:45:50 +03:00
parent 1442a2ae87
commit 27772d2767
2 changed files with 9 additions and 11 deletions

View File

@@ -1131,16 +1131,12 @@ class TBGatewayService:
return data
def __send_data_pack_to_storage(self, data, connector_name, connector_id=None):
try:
json_data = dumps(data)
save_result = self._event_storage.put(json_data)
if not save_result:
log.error('%rData from the device "%s" cannot be saved, connector name is %s.',
"[" + connector_id + "] " if connector_id is not None else "",
data["deviceName"], connector_name)
except Exception as e:
log.error('CONVERTING ERROR | %s', data)
log.exception(e)
json_data = dumps(data)
save_result = self._event_storage.put(json_data)
if not save_result:
log.error('%rData from the device "%s" cannot be saved, connector name is %s.',
"[" + connector_id + "] " if connector_id is not None else "",
data["deviceName"], connector_name)
def check_size(self, devices_data_in_event_pack):
if (self.__get_data_size(devices_data_in_event_pack)