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

Change ERROR to WARNING in statistics service log

This commit is contained in:
samson0v
2022-11-18 12:00:42 +02:00
parent f43e9960cf
commit 84d00ea784
2 changed files with 7 additions and 6 deletions

View File

@@ -62,10 +62,10 @@ class StatisticsService(Thread):
for attribute in self._config:
try:
process = subprocess.run(attribute['command'], stdout=subprocess.PIPE, stderr=subprocess.PIPE,
encoding='utf-8', timeout=attribute['timeout'])
encoding='utf-8', timeout=attribute['timeout'])
except Exception as e:
self._log.error("Statistic parameter %s raise the exception: %s",
attribute['attributeOnGateway'], e)
self._log.warning("Statistic parameter %s raise the exception: %s",
attribute['attributeOnGateway'], e)
continue
value = process.stdout

View File

@@ -245,9 +245,6 @@ class TBGatewayService:
'configuration') else None)
self._published_events = SimpleQueue()
self._send_thread = Thread(target=self.__read_data_from_storage, daemon=True,
name="Send data to Thingsboard Thread")
self._send_thread.start()
self.__min_pack_send_delay_ms = self.__config['thingsboard'].get('minPackSendDelayMS', 200)
if self.__min_pack_send_delay_ms == 0:
@@ -255,6 +252,10 @@ class TBGatewayService:
self.__min_pack_send_delay_ms = self.__min_pack_send_delay_ms / 1000.0
self._send_thread = Thread(target=self.__read_data_from_storage, daemon=True,
name="Send data to Thingsboard Thread")
self._send_thread.start()
log.info("Gateway started.")
self._watchers_thread = Thread(target=self._watchers, name='Watchers', daemon=True)