From 8c1a8bde540d8538cd305be96aa183928eb943e0 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 1 Apr 2025 17:40:22 +0300 Subject: [PATCH] dspace_statistics_api/app.py: replace set_session Replace connection.set_session() with connection.set_read_only(). --- dspace_statistics_api/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace_statistics_api/app.py b/dspace_statistics_api/app.py index 28bddcd..1e266b2 100644 --- a/dspace_statistics_api/app.py +++ b/dspace_statistics_api/app.py @@ -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()