From 64744b5ff31187754510e069f53d2e2df0523171 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Tue, 8 Oct 2024 20:39:24 +0000 Subject: [PATCH] fix: hanging sorter --- yearn/treasury/accountant/cost_of_revenue/general.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yearn/treasury/accountant/cost_of_revenue/general.py b/yearn/treasury/accountant/cost_of_revenue/general.py index 0833b0114..769afa77b 100644 --- a/yearn/treasury/accountant/cost_of_revenue/general.py +++ b/yearn/treasury/accountant/cost_of_revenue/general.py @@ -1,5 +1,6 @@ import asyncio +import functools import logging from brownie import chain, convert @@ -37,9 +38,13 @@ } }.get(chain.id, {}) + def _get_flat_wrappers(partner: Partner): + loop = asyncio.get_event_loop() # A helper function so we can run this sync without either breaking the event loop in our main thread or making this module async - return asyncio.get_event_loop().run_until_complete(partner.flat_wrappers) + wrappers = [] #if loop.is_running() else loop.run_until_complete(partner.flat_wrappers) + logger.info("loaded %s wrappers for %s", len(wrappers), partner) + return wrappers def is_partner_fees(tx: TreasuryTx) -> bool: if tx.from_address.address == constants.YCHAD_MULTISIG and tx.to_address: