forked from platypush/platypush
Always define msg so the function doesn't fail on exception
Reverted the previous retry logic for backend - it didn't really work This reverts commit4e0e4863a0
. This reverts commit964c7b5cf0
. This reverts commit6ce348365f
.
This commit is contained in:
parent
4e0e4863a0
commit
284e0638f8
28 changed files with 267 additions and 273 deletions
platypush/backend
|
@ -45,7 +45,7 @@ class MqttBackend(Backend):
|
|||
publisher.single(self.topic, str(msg), hostname=self.host, port=self.port)
|
||||
|
||||
|
||||
def exec(self):
|
||||
def run(self):
|
||||
def on_connect(client, userdata, flags, rc):
|
||||
client.subscribe(self.topic)
|
||||
|
||||
|
@ -57,6 +57,7 @@ class MqttBackend(Backend):
|
|||
self.logger.info('Received message on the MQTT backend: {}'.format(msg))
|
||||
self.on_message(msg)
|
||||
|
||||
super().run()
|
||||
client = mqtt.Client()
|
||||
client.on_connect = on_connect
|
||||
client.on_message = on_message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue