diff --git a/app.py b/app.py index e2794c4..49f89f3 100644 --- a/app.py +++ b/app.py @@ -1,10 +1,8 @@ from database import database_connection import falcon -from solr import solr_connection db = database_connection() db.set_session(readonly=True) -solr = solr_connection() class AllItemsResource: def on_get(self, req, resp): @@ -65,6 +63,9 @@ class ItemResource: cursor.close() +def on_exit(api): + print("Shutting down DB") + api = falcon.API() api.add_route('/items', AllItemsResource()) api.add_route('/item/{item_id:int}', ItemResource())