Don't resubscribe immediately after connection loss
This commit is contained in:
parent
c83f3cfcdf
commit
8e43db2533
1 changed files with 4 additions and 1 deletions
|
@ -128,7 +128,10 @@ class NtfyBot(Plugin):
|
||||||
exc = task.exception()
|
exc = task.exception()
|
||||||
self.log.exception(
|
self.log.exception(
|
||||||
"Subscription task errored, resubscribing", exc_info=exc)
|
"Subscription task errored, resubscribing", exc_info=exc)
|
||||||
self.subscribe_to_topic(topic)
|
self.tasks[topic.id] = self.loop.create_task(
|
||||||
|
asyncio.sleep(10.0))
|
||||||
|
self.tasks[topic.id].add_done_callback(
|
||||||
|
lambda _: self.subscribe_to_topic(topic))
|
||||||
|
|
||||||
self.log.info("Subscribing to %s/%s", topic.server, topic.topic)
|
self.log.info("Subscribing to %s/%s", topic.server, topic.topic)
|
||||||
url = "%s/%s/json" % (topic.server, topic.topic)
|
url = "%s/%s/json" % (topic.server, topic.topic)
|
||||||
|
|
Loading…
Reference in a new issue