Skip to content

Commit

Permalink
fix(cli): bad resource release order
Browse files Browse the repository at this point in the history
  • Loading branch information
Whth committed Jun 22, 2024
1 parent eb32d93 commit 59d0dce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kazu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def configure(


@main.command("run")
@click.pass_context
@click.pass_obj
@click.help_option("-h", "--help")
@click.option(
Expand Down Expand Up @@ -177,7 +178,7 @@ def configure(
help=f"run mode, also can receive env {Env.KAZU_RUN_MODE}",
envvar=Env.KAZU_RUN_MODE,
)
def run(conf: _InternalConfig, run_config_path: Path | None, mode: str, **_):
def run(ctx: click.Context, conf: _InternalConfig, run_config_path: Path | None, mode: str, **_):
"""
Run command for the main group.
"""
Expand Down Expand Up @@ -252,7 +253,7 @@ def run(conf: _InternalConfig, run_config_path: Path | None, mode: str, **_):
tag_detector.release_camera()
sensors.adc_io_close()
_logger.info(f"KAZU stopped.")
return
ctx.exit(0)


@main.command("check")
Expand Down

0 comments on commit 59d0dce

Please sign in to comment.