1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-12-22 20:52:19 +01:00

dspace_statistics_api/app.py: Use ORDER BY in /items

Since we are paging through the results by limit/offset we need to
be sure that we are returning results deterministically.
This commit is contained in:
Alan Orth 2020-12-17 10:10:40 +02:00
parent 8b924cf450
commit 4590fc8708
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -31,7 +31,7 @@ class AllItemsResource:
# get statistics and use limit and offset to page through results
cursor.execute(
"SELECT id, views, downloads FROM items LIMIT %s OFFSET %s",
"SELECT id, views, downloads FROM items ORDER BY id LIMIT %s OFFSET %s",
[limit, offset],
)