mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
fix first paginate method
This commit is contained in:
@@ -84,9 +84,8 @@ def _insert_inbound_sms_history(subquery, query_limit=10000):
|
|||||||
InboundSms.provider,
|
InboundSms.provider,
|
||||||
).where(InboundSms.id.in_(subquery_select))
|
).where(InboundSms.id.in_(subquery_select))
|
||||||
|
|
||||||
count_query = select(func.count()).select_from(inbound_sms_query.subquery()).scalar()
|
count_query = select(func.count()).select_from(inbound_sms_query.subquery())
|
||||||
print(f"COUNT QUERY {count_query}")
|
inbound_sms_count = db.session.execute(count_query).scalar() or 0
|
||||||
inbound_sms_count = db.session.execute(count_query) or 0
|
|
||||||
|
|
||||||
while offset < inbound_sms_count:
|
while offset < inbound_sms_count:
|
||||||
statement = insert(InboundSmsHistory).from_select(
|
statement = insert(InboundSmsHistory).from_select(
|
||||||
|
|||||||
Reference in New Issue
Block a user