1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2025-04-14 02:29:23 +02:00

dspace_statistics_api/app.py: replace set_session

Replace connection.set_session() with connection.set_read_only().
This commit is contained in:
Alan Orth 2025-04-01 17:40:22 +03:00
parent ffe6030a9e
commit 8c1a8bde54
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -76,7 +76,7 @@ class AllStatisticsResource:
offset = limit * page
with DatabaseManager() as db:
db.set_session(readonly=True)
db.set_read_only(True)
with db.cursor() as cursor:
# get total number of communities/collections/items so we can estimate the pages
@ -190,7 +190,7 @@ class SingleStatisticsResource:
psycopg2.extras.register_uuid()
with DatabaseManager() as db:
db.set_session(readonly=True)
db.set_read_only(True)
with db.cursor() as cursor:
cursor = db.cursor()