mirror of
https://github.com/thingsboard/thingsboard-gateway
synced 2025-10-26 22:31:42 +08:00
Added RATE_LIMITS env variable
This commit is contained in:
@@ -132,9 +132,15 @@ class TBClient(threading.Thread):
|
||||
if credentials.get("clientId") is not None:
|
||||
self.__client_id = str(credentials["clientId"])
|
||||
|
||||
self.client = TBGatewayMqttClient(self.__host, self.__port, self.__username, self.__password, self,
|
||||
quality_of_service=self.__default_quality_of_service,
|
||||
client_id=self.__client_id)
|
||||
if self.__config.get('rateLimits'):
|
||||
self.client = TBGatewayMqttClient(self.__host, self.__port, self.__username, self.__password, self,
|
||||
quality_of_service=self.__default_quality_of_service,
|
||||
client_id=self.__client_id, rate_limit=self.__config['rateLimits'])
|
||||
else:
|
||||
self.client = TBGatewayMqttClient(self.__host, self.__port, self.__username, self.__password, self,
|
||||
quality_of_service=self.__default_quality_of_service,
|
||||
client_id=self.__client_id)
|
||||
|
||||
if self.__tls:
|
||||
self.__ca_cert = self.__config_folder_path + credentials.get("caCert") if credentials.get(
|
||||
"caCert") is not None else None
|
||||
|
||||
@@ -132,6 +132,8 @@ def get_env_variables():
|
||||
env_variables['username'] = environ.get('TB_GW_USERNAME')
|
||||
if environ.get('TB_GW_PASSWORD'):
|
||||
env_variables['password'] = environ.get('TB_GW_PASSWORD')
|
||||
if environ.get('TB_GW_RATE_LIMITS'):
|
||||
env_variables['rateLimits'] = environ.get('TB_GW_RATE_LIMITS')
|
||||
|
||||
converted_env_variables = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user