mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2025-04-15 11:09:25 +02:00
dspace_statistics_api/app.py: replace set_session
Replace connection.set_session() with connection.set_read_only().
This commit is contained in:
parent
ffe6030a9e
commit
8c1a8bde54
@ -76,7 +76,7 @@ class AllStatisticsResource:
|
|||||||
offset = limit * page
|
offset = limit * page
|
||||||
|
|
||||||
with DatabaseManager() as db:
|
with DatabaseManager() as db:
|
||||||
db.set_session(readonly=True)
|
db.set_read_only(True)
|
||||||
|
|
||||||
with db.cursor() as cursor:
|
with db.cursor() as cursor:
|
||||||
# get total number of communities/collections/items so we can estimate the pages
|
# get total number of communities/collections/items so we can estimate the pages
|
||||||
@ -190,7 +190,7 @@ class SingleStatisticsResource:
|
|||||||
psycopg2.extras.register_uuid()
|
psycopg2.extras.register_uuid()
|
||||||
|
|
||||||
with DatabaseManager() as db:
|
with DatabaseManager() as db:
|
||||||
db.set_session(readonly=True)
|
db.set_read_only(True)
|
||||||
|
|
||||||
with db.cursor() as cursor:
|
with db.cursor() as cursor:
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user