Add , indicates hist size to decrement to storage logic
parent
423af37389
commit
c672493998
|
@ -33,7 +33,22 @@ class SymbolNotFound(BrokerError):
|
||||||
|
|
||||||
|
|
||||||
class NoData(BrokerError):
|
class NoData(BrokerError):
|
||||||
"Symbol data not permitted"
|
'''
|
||||||
|
Symbol data not permitted or no data
|
||||||
|
for time range found.
|
||||||
|
|
||||||
|
'''
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
*args,
|
||||||
|
frame_size: int = 1000,
|
||||||
|
|
||||||
|
) -> None:
|
||||||
|
super().__init__(*args)
|
||||||
|
|
||||||
|
# when raised, machinery can check if the backend
|
||||||
|
# set a "frame size" for doing datetime calcs.
|
||||||
|
self.frame_size: int = 1000
|
||||||
|
|
||||||
|
|
||||||
def resproc(
|
def resproc(
|
||||||
|
@ -50,12 +65,12 @@ def resproc(
|
||||||
if not resp.status_code == 200:
|
if not resp.status_code == 200:
|
||||||
raise BrokerError(resp.body)
|
raise BrokerError(resp.body)
|
||||||
try:
|
try:
|
||||||
json = resp.json()
|
msg = resp.json()
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
log.exception(f"Failed to process {resp}:\n{resp.text}")
|
log.exception(f"Failed to process {resp}:\n{resp.text}")
|
||||||
raise BrokerError(resp.text)
|
raise BrokerError(resp.text)
|
||||||
|
|
||||||
if log_resp:
|
if log_resp:
|
||||||
log.debug(f"Received json contents:\n{colorize_json(json)}")
|
log.debug(f"Received json contents:\n{colorize_json(msg)}")
|
||||||
|
|
||||||
return json if return_json else resp
|
return msg if return_json else resp
|
||||||
|
|
Loading…
Reference in New Issue