Skip to content

Commit

Permalink
Merge pull request #2382 from CounterpartyXCP/init-wsgi
Browse files Browse the repository at this point in the history
init `wsgi_server`
  • Loading branch information
adamkrellenstein authored Oct 17, 2024
2 parents 5f5478d + f72f7e2 commit fa046b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion counterparty-core/counterpartycore/lib/api/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ def run_api_server(args, interruped_value, server_ready_value):
logger.info("Starting API Server...")
app = init_flask_app()

wsgi_server = None

try:
# Init the HTTP Server.
wsgi_server = wsgi.WSGIApplication(app, args=args)
Expand All @@ -415,7 +417,8 @@ def run_api_server(args, interruped_value, server_ready_value):
logger.trace("Shutting down API Server...")
watcher.stop()
watcher.join()
wsgi_server.stop()
if wsgi_server is not None:
wsgi_server.stop()
APIDBConnectionPool().close()


Expand Down

0 comments on commit fa046b9

Please sign in to comment.