forked from platypush/platypush
Prepend the class name to the string used to generate the MQTT client_id hash.
If we include the class name by default then we won't have to explicitly modify the client_id in the implementation classes in order to prevent clashes.
This commit is contained in:
parent
3104a59f44
commit
4cb5aa7acb
1 changed files with 2 additions and 0 deletions
|
@ -143,6 +143,7 @@ class MqttPlugin(RunnablePlugin):
|
|||
|
||||
self._listeners_lock = defaultdict(threading.RLock)
|
||||
self.listeners: Dict[str, MqttClient] = {} # client_id -> MqttClient map
|
||||
self.timeout = timeout
|
||||
self.default_listener = (
|
||||
self._get_client(
|
||||
host=host,
|
||||
|
@ -188,6 +189,7 @@ class MqttPlugin(RunnablePlugin):
|
|||
client_hash = hashlib.sha1(
|
||||
'|'.join(
|
||||
[
|
||||
self.__class__.__name__,
|
||||
host,
|
||||
str(port),
|
||||
json.dumps(sorted(topics)),
|
||||
|
|
Loading…
Reference in a new issue