Improve CLI

This commit is contained in:
Andras Schmelczer 2022-07-08 13:27:25 +02:00
parent 65ec6d6f9b
commit c2d2bf49f1
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
3 changed files with 15 additions and 7 deletions

View file

@ -40,7 +40,7 @@ GREAT_AI_LOGGING_CONFIG = {
}
def main() -> None:
def serve() -> None:
args = parse_arguments()
should_auto_reload = not _is_in_production_mode(logger=None)
@ -200,10 +200,14 @@ class GreatAIReload(BaseReload):
sock.close()
if __name__ == "__main__":
def main() -> None:
try:
main()
serve()
except KeyboardInterrupt:
exit()
except Exception as e:
logger.error(e)
if __name__ == "__main__":
main()