mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-12-22 12:42:19 +01:00
app.py: Don't initialize Solr connection
We only need Solr in the indexing component, not for the API itself.
This commit is contained in:
parent
568ff2eebb
commit
963aa245c8
5
app.py
5
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())
|
||||
|
Loading…
Reference in New Issue
Block a user