Fix silly thinko
This commit is contained in:
parent
312708e2e7
commit
7496b511b8
@ -49,18 +49,18 @@ class Daemon(util.LoggedClass):
|
|||||||
Handles temporary connection issues. Daemon reponse errors
|
Handles temporary connection issues. Daemon reponse errors
|
||||||
are raise through DaemonError.
|
are raise through DaemonError.
|
||||||
'''
|
'''
|
||||||
prior_msg = None
|
self.prior_msg = None
|
||||||
skip_count = None
|
self.skip_count = None
|
||||||
|
|
||||||
def log_error(msg, skip_once=False):
|
def log_error(msg, skip_once=False):
|
||||||
if skip_once and skip_count is None:
|
if skip_once and self.skip_count is None:
|
||||||
skip_count = 1
|
self.skip_count = 1
|
||||||
if msg != prior_msg or skip_count == 0:
|
if msg != self.prior_msg or self.skip_count == 0:
|
||||||
skip_count = 10
|
self.skip_count = 10
|
||||||
prior_msg = msg
|
self.prior_msg = msg
|
||||||
self.logger.error('{}. Retrying between sleeps...'
|
self.logger.error('{}. Retrying between sleeps...'
|
||||||
.format(msg))
|
.format(msg))
|
||||||
skip_count -= 1
|
self.skip_count -= 1
|
||||||
|
|
||||||
data = json.dumps(payload)
|
data = json.dumps(payload)
|
||||||
secs = 1
|
secs = 1
|
||||||
@ -69,7 +69,7 @@ class Daemon(util.LoggedClass):
|
|||||||
async with self.workqueue_semaphore:
|
async with self.workqueue_semaphore:
|
||||||
async with aiohttp.post(self.url, data=data) as resp:
|
async with aiohttp.post(self.url, data=data) as resp:
|
||||||
result = processor(await resp.json())
|
result = processor(await resp.json())
|
||||||
if prior_msg:
|
if self.prior_msg:
|
||||||
self.logger.info('connection restored')
|
self.logger.info('connection restored')
|
||||||
return result
|
return result
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user