Skip to content

Commit

Permalink
Try to get concurrency working
Browse files Browse the repository at this point in the history
  • Loading branch information
mcamou committed Aug 14, 2024
1 parent ee1beff commit 16c64c6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions program_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ async def sync(

# Sync product/price accounts

transactions: list[Coroutine[Any, Any, None]] = []
transactions: List[asyncio.Task[None]] = []

product_updates: bool = False

Expand All @@ -282,7 +282,9 @@ async def sync(
instructions.extend(product_instructions)
if send_transactions:
transactions.append(
self.send_transaction(product_instructions, product_keypairs)
asyncio.create_task(
self.send_transaction(product_instructions, product_keypairs)
)
)

await asyncio.gather(*transactions)
Expand All @@ -308,7 +310,9 @@ async def sync(
instructions.extend(price_instructions)
if send_transactions:
transactions.append(
self.send_transaction(price_instructions, price_keypairs)
asyncio.create_task(
self.send_transaction(price_instructions, price_keypairs)
)
)

await asyncio.gather(*transactions)
Expand Down

0 comments on commit 16c64c6

Please sign in to comment.