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 <[email protected]>
  • Loading branch information
jmontleon committed Sep 16, 2024
1 parent fa08eb4 commit 61f875e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kai/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import argparse
import logging
import pprint
import signal
from functools import cache

from aiohttp import web
Expand Down Expand Up @@ -44,6 +45,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 61f875e

Please sign in to comment.