Treat RPC response=None as a WarmingUpError.

This commit is contained in:
Jonathan Moody 2022-09-05 11:09:43 -05:00 committed by Jack Robison
parent 59043a9add
commit 75d53c3c6f

View file

@ -183,6 +183,8 @@ class LBCDaemon:
start = time.perf_counter() start = time.perf_counter()
def processor(result): def processor(result):
if result is None:
raise WarmingUpError
err = result['error'] err = result['error']
if not err: if not err:
return result['result'] return result['result']
@ -207,6 +209,8 @@ class LBCDaemon:
start = time.perf_counter() start = time.perf_counter()
def processor(result): def processor(result):
if result is None:
raise WarmingUpError
errs = [item['error'] for item in result if item['error']] errs = [item['error'] for item in result if item['error']]
if any(err.get('code') == self.WARMING_UP for err in errs): if any(err.get('code') == self.WARMING_UP for err in errs):
raise WarmingUpError raise WarmingUpError