Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
Catch KeyboardInterrupt + log on startup (#66) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
FabijanC authored Mar 30, 2022
1 parent ae9f263 commit 2b3e97f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions starknet_devnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
A server exposing Starknet functionalities as API endpoints.
"""

import os
import sys
import meinheld
import dill as pickle
Expand All @@ -28,11 +27,6 @@
def main():
"""Runs the server."""

# pylint: disable=global-statement, invalid-name

# reduce startup logging
os.environ["WERKZEUG_RUN_MAIN"] = "true"

args = parse_args()

# Uncomment this once fork support is added
Expand All @@ -57,7 +51,10 @@ def main():

try:
meinheld.listen((args.host, args.port))
print(f" * Listening on http://{args.host}:{args.port}/ (Press CTRL+C to quit)")
meinheld.run(app)
except KeyboardInterrupt:
pass
finally:
if args.dump_on == DumpOn.EXIT:
state.dumper.dump()
Expand Down

0 comments on commit 2b3e97f

Please sign in to comment.