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 759fb99
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kai/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import argparse
import logging
import pprint
import signal

from functools import cache

from aiohttp import web
Expand Down Expand Up @@ -44,6 +46,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 759fb99

Please sign in to comment.