You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I first started trying reviews, ^C didn't work very well... I had to bash it several times to get the app to quit.
Looking a bit closer, at the code, render in tasks.py is actually a blocking function.
In cli/main.py all of the async code can be removed:
import asyncclick as click
from ..tasks import render, single_render
from ..version import __version__
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(__version__, "-v", "--version", message="version %(version)s")
def cli() -> None:
"""Reviews - A terminal UI Dashboard for monitoring code review requests.\n
For feature requests or bug reports: https://github.com/apoclyps/reviews/issues
"""
@cli.command(help="Visualize code review requests as a Dashboard")
@click.option("-r", "--reload/--no-reload", default=True, is_flag=True)
def dashboard(reload: bool) -> None:
"""
Command:\n
reviews dashboard
Usage:\n
reviews dashboard --reload \n
reviews dashboard --no-reload \n
"""
click.echo("loading dashboard")
if reload:
render()
else:
single_render()
def main() -> None:
"""Entry point to CLI"""
cli()
In my few manual tests this runs exactly the same as it did before - but now ^C will actually exit the program.
The text was updated successfully, but these errors were encountered:
apoclyps
changed the title
Async isn't actually being used, and prevents ctrl+c from correctly exiting the app
[BUG] Async isn't actually being used, and prevents ctrl+c from correctly exiting the app
May 22, 2021
Thanks for the feedback @waynew and opening this bug ticket - I agree this was a pain point of using reviews.
For context (if others review this thread in the future). The initial spike introduced asyncclick as a quick and easy way to split the updates from renders but it was never fully implemented and a lot of the code got left around. #95 and #109 was the start of removing it but it's great to finally remove async and resolve this bug.
I'll ship a 0.1.8 version with the latest fixes today
When I first started trying reviews, ^C didn't work very well... I had to bash it several times to get the app to quit.
Looking a bit closer, at the code,
render
in tasks.py is actually a blocking function.In
cli/main.py
all of the async code can be removed:In my few manual tests this runs exactly the same as it did before - but now ^C will actually exit the program.
The text was updated successfully, but these errors were encountered: