Skip to content

Commit

Permalink
Merge pull request adafruit#29 from jimbobbennett/master
Browse files Browse the repository at this point in the history
Stop the reconnect infinite loop
  • Loading branch information
brentru authored Apr 21, 2020
2 parents 2cbd472 + dbb1b93 commit 195bfc0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,10 @@ def reconnect(self, resub_topics=True):
self.logger.debug(
"Attempting to resubscribe to previously subscribed topics."
)
while self._subscribed_topics:
feed = self._subscribed_topics.pop()
subscribed_topics = self._subscribed_topics.copy()
self._subscribed_topics = []
while subscribed_topics:
feed = subscribed_topics.pop()
self.subscribe(feed)

def loop_forever(self):
Expand Down

0 comments on commit 195bfc0

Please sign in to comment.