Skip to content

Commit

Permalink
fix: hanging sorter
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Nov 9, 2024
1 parent 27257da commit 64744b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yearn/treasury/accountant/cost_of_revenue/general.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import asyncio
import functools
import logging

from brownie import chain, convert
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 64744b5

Please sign in to comment.