Remove remaining `fqsn` usage from code base minus backward compats
parent
dd10acbbf9
commit
7f246697b4
|
@ -191,7 +191,7 @@ class BrokerdOrder(Struct):
|
||||||
account: str
|
account: str
|
||||||
time_ns: int
|
time_ns: int
|
||||||
|
|
||||||
symbol: str # fqsn
|
symbol: str # fqme
|
||||||
price: float
|
price: float
|
||||||
size: float
|
size: float
|
||||||
|
|
||||||
|
|
|
@ -618,10 +618,10 @@ async def sample_and_broadcast(
|
||||||
] = bus.get_subs(sub_key)
|
] = bus.get_subs(sub_key)
|
||||||
|
|
||||||
# NOTE: by default the broker backend doesn't append
|
# NOTE: by default the broker backend doesn't append
|
||||||
# it's own "name" into the fqsn schema (but maybe it
|
# it's own "name" into the fqme schema (but maybe it
|
||||||
# should?) so we have to manually generate the correct
|
# should?) so we have to manually generate the correct
|
||||||
# key here.
|
# key here.
|
||||||
fqsn = f'{broker_symbol}.{brokername}'
|
fqme = f'{broker_symbol}.{brokername}'
|
||||||
lags: int = 0
|
lags: int = 0
|
||||||
|
|
||||||
# TODO: speed up this loop in an AOT compiled lang (like
|
# TODO: speed up this loop in an AOT compiled lang (like
|
||||||
|
@ -640,7 +640,7 @@ async def sample_and_broadcast(
|
||||||
# pushes to the ``uniform_rate_send()`` below.
|
# pushes to the ``uniform_rate_send()`` below.
|
||||||
try:
|
try:
|
||||||
stream.send_nowait(
|
stream.send_nowait(
|
||||||
(fqsn, quote)
|
(fqme, quote)
|
||||||
)
|
)
|
||||||
except trio.WouldBlock:
|
except trio.WouldBlock:
|
||||||
overruns[sub_key] += 1
|
overruns[sub_key] += 1
|
||||||
|
@ -672,7 +672,7 @@ async def sample_and_broadcast(
|
||||||
raise trio.BrokenResourceError
|
raise trio.BrokenResourceError
|
||||||
else:
|
else:
|
||||||
await stream.send(
|
await stream.send(
|
||||||
{fqsn: quote}
|
{fqme: quote}
|
||||||
)
|
)
|
||||||
|
|
||||||
if cs.cancelled_caught:
|
if cs.cancelled_caught:
|
||||||
|
|
|
@ -184,10 +184,10 @@ def storage(
|
||||||
symbol = symbols[0]
|
symbol = symbols[0]
|
||||||
async with open_tsdb_client(symbol) as storage:
|
async with open_tsdb_client(symbol) as storage:
|
||||||
if delete:
|
if delete:
|
||||||
for fqsn in symbols:
|
for fqme in symbols:
|
||||||
syms = await storage.client.list_symbols()
|
syms = await storage.client.list_symbols()
|
||||||
|
|
||||||
resp60s = await storage.delete_ts(fqsn, 60)
|
resp60s = await storage.delete_ts(fqme, 60)
|
||||||
|
|
||||||
msgish = resp60s.ListFields()[0][1]
|
msgish = resp60s.ListFields()[0][1]
|
||||||
if 'error' in str(msgish):
|
if 'error' in str(msgish):
|
||||||
|
@ -199,15 +199,15 @@ def storage(
|
||||||
# well, if we ever can make this work we
|
# well, if we ever can make this work we
|
||||||
# probably want to dogsplain the real reason
|
# probably want to dogsplain the real reason
|
||||||
# for the delete errurz..llululu
|
# for the delete errurz..llululu
|
||||||
if fqsn not in syms:
|
if fqme not in syms:
|
||||||
log.error(f'Pair {fqsn} dne in DB')
|
log.error(f'Pair {fqme} dne in DB')
|
||||||
|
|
||||||
log.error(f'Deletion error: {fqsn}\n{msgish}')
|
log.error(f'Deletion error: {fqme}\n{msgish}')
|
||||||
|
|
||||||
resp1s = await storage.delete_ts(fqsn, 1)
|
resp1s = await storage.delete_ts(fqme, 1)
|
||||||
msgish = resp1s.ListFields()[0][1]
|
msgish = resp1s.ListFields()[0][1]
|
||||||
if 'error' in str(msgish):
|
if 'error' in str(msgish):
|
||||||
log.error(f'Deletion error: {fqsn}\n{msgish}')
|
log.error(f'Deletion error: {fqme}\n{msgish}')
|
||||||
|
|
||||||
trio.run(main)
|
trio.run(main)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue