minor touchups
This commit is contained in:
@@ -107,7 +107,7 @@ async def handle_order_placed(event: EventData):
|
|||||||
try:
|
try:
|
||||||
vault_owners[addr] = await VaultContract(addr).owner()
|
vault_owners[addr] = await VaultContract(addr).owner()
|
||||||
except Exception:
|
except Exception:
|
||||||
log.warning(f'vault owner for {addr} could not be found.')
|
log.warning(f'vault owner for {addr} could not be found.', exc_info=True)
|
||||||
return
|
return
|
||||||
vault = VaultContract(addr)
|
vault = VaultContract(addr)
|
||||||
for index in range(start_index, start_index+num_orders):
|
for index in range(start_index, start_index+num_orders):
|
||||||
@@ -239,13 +239,13 @@ def handle_vault_created(created: EventData):
|
|||||||
|
|
||||||
async def activate_time_triggers():
|
async def activate_time_triggers():
|
||||||
now = current_clock.get().now()
|
now = current_clock.get().now()
|
||||||
log.debug(f'activating time triggers at {now}')
|
# log.debug(f'activating time triggers at {now}')
|
||||||
# time triggers
|
# time triggers
|
||||||
for tt in tuple(time_triggers):
|
for tt in tuple(time_triggers):
|
||||||
await maywait(tt(now))
|
await maywait(tt(now))
|
||||||
|
|
||||||
async def activate_price_triggers():
|
async def activate_price_triggers():
|
||||||
log.debug(f'activating price triggers')
|
# log.debug(f'activating price triggers')
|
||||||
pools_triggered = set()
|
pools_triggered = set()
|
||||||
for pool, price in new_pool_prices.items():
|
for pool, price in new_pool_prices.items():
|
||||||
pools_triggered.add(pool)
|
pools_triggered.add(pool)
|
||||||
|
|||||||
@@ -186,15 +186,12 @@ class BlockStateRunner:
|
|||||||
async with asyncio.timeout(1): # check running flag every second
|
async with asyncio.timeout(1): # check running flag every second
|
||||||
head = await self.queue.get()
|
head = await self.queue.get()
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
log.debug('timeout in runner')
|
|
||||||
# 1 second has passed without a new head. Run the postprocess callbacks to check for activated time-based triggers
|
# 1 second has passed without a new head. Run the postprocess callbacks to check for activated time-based triggers
|
||||||
if prev_head is not None:
|
if prev_head is not None:
|
||||||
await self.handle_time_tick(head)
|
await self.handle_time_tick(head)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
log.debug('handle head...')
|
|
||||||
await self.handle_head(chain, head, w3)
|
await self.handle_head(chain, head, w3)
|
||||||
log.debug('handled')
|
|
||||||
prev_head = head
|
prev_head = head
|
||||||
except Exception as x:
|
except Exception as x:
|
||||||
log.exception(x)
|
log.exception(x)
|
||||||
|
|||||||
Reference in New Issue
Block a user