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
1 changed files with 1 additions and 1 deletions

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],
)