mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
try handmade pagination
This commit is contained in:
@@ -67,11 +67,11 @@ def dao_get_jobs_by_service_id(
|
|||||||
query_filter.append(Job.job_status.in_(statuses))
|
query_filter.append(Job.job_status.in_(statuses))
|
||||||
|
|
||||||
total_items = db.session.execute(
|
total_items = db.session.execute(
|
||||||
select(func.count()).select_from(*query_filter).scalar_one()
|
select(func.count()).select_from(Job).filter(*query_filter).scalar_one()
|
||||||
)
|
)
|
||||||
|
|
||||||
stmt = (
|
stmt = (
|
||||||
select(*query_filter)
|
select(Job).filter(*query_filter)
|
||||||
.order_by(Job.processing_started.desc(), Job.created_at.desc())
|
.order_by(Job.processing_started.desc(), Job.created_at.desc())
|
||||||
.limit(page_size)
|
.limit(page_size)
|
||||||
.offset(page)
|
.offset(page)
|
||||||
|
|||||||
Reference in New Issue
Block a user