Skip to content

Commit

Permalink
Reconnect aio_etcd_client on timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert committed Sep 2, 2017
1 parent 0fa3c47 commit 159624b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tuxeatpi_common/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ async def read(self, watch=False):
self.logger.info("Component settings not found, waiting")
await asyncio.sleep(3)
continue
except asyncio.TimeoutError:
continue
self.logger.info("Component settings received")
self.params = json.loads(raw_data.value) # pylint: disable=E1101
self.component.set_config(config=self.params)
Expand All @@ -88,6 +90,8 @@ async def read_global(self, watch=False):
self.logger.info("Global settings not found, waiting")
await asyncio.sleep(3)
continue
except asyncio.TimeoutError:
continue
self.logger.info("Global settings received")
data = json.loads(raw_data.value)
if data.get('language') != self.language:
Expand Down

0 comments on commit 159624b

Please sign in to comment.