Skip to content

Commit

Permalink
Exit gracefully when receiving sigint (ctrl-c)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
  • Loading branch information
jmontleon committed Sep 16, 2024
1 parent fa08eb4 commit cb7d929
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kai/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import argparse
import logging
import pprint
import signal
import sys

Check failure on line 9 in kai/server.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(F401)

[new] `sys` imported but unused

from functools import cache

from aiohttp import web
Expand Down Expand Up @@ -44,6 +47,7 @@ def get_config():


def app() -> web.Application:
signal.signal(signal.SIGINT, signal.SIG_IGN)
config = get_config()

print(f"Config loaded: {pprint.pformat(config)}")
Expand Down

0 comments on commit cb7d929

Please sign in to comment.