Skip to content

Coroutine was not awaited error when running command.stamp() in async dialect #1515

Discussion options

You must be logged in to vote

Hi,

You will need to modify your code to conditionally use asyncio.run or the existing loop to run the run_async_migrations coroutine.
something like this could work

def run_migrations_online() -> None:
    """Run migrations in 'online' mode."""

    try:
      asyncio.get_running_loop().run_until_complete(run_async_migrations())
      return
    except RuntimeError:
      pass
    asyncio.run(run_async_migrations())

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@CaselIT
Comment options

@zzzeek
Comment options

@EricScottN
Comment options

@zzzeek
Comment options

@zzzeek
Comment options

Answer selected by EricScottN
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants
Converted from issue

This discussion was converted from issue #1514 on August 05, 2024 19:52.