Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion blurry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def runserver():

SETTINGS["RUNSERVER"] = True

event_loop = asyncio.get_event_loop()
event_loop = asyncio.new_event_loop()
asyncio.set_event_loop(event_loop)
event_loop.create_task(build(release=False))

jinja_env = get_jinja_env()
Expand Down
3 changes: 2 additions & 1 deletion blurry/async_typer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def decorator(async_func):
# Convert async function to synchronous
@wraps(async_func)
def sync_func(*_args, **_kwargs):
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
return loop.run_until_complete(async_func(*_args, **_kwargs))

# Register synchronous function
Expand Down
Loading