Skip to content

Commit

Permalink
Merge pull request #1511 from GSA/notify-api-1494
Browse files Browse the repository at this point in the history
Evaluate Batch Updates versus Bulk Updates
  • Loading branch information
terrazoon authored Jan 7, 2025
2 parents 7fe2ec2 + ef57a10 commit f466cf2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/dao/notifications_dao.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from datetime import timedelta
from time import time

from flask import current_app
from sqlalchemy import (
Expand Down Expand Up @@ -727,6 +728,7 @@ def get_service_ids_with_notifications_on_date(notification_type, date):


def dao_update_delivery_receipts(receipts, delivered):
start_time_millis = time() * 1000
new_receipts = []
for r in receipts:
if isinstance(r, str):
Expand Down Expand Up @@ -773,3 +775,8 @@ def dao_update_delivery_receipts(receipts, delivered):
)
db.session.execute(stmt)
db.session.commit()
elapsed_time = (time() * 1000) - start_time_millis
current_app.logger.info(
f"#loadtestperformance batch update query time: \
updated {len(receipts)} notification in {elapsed_time} ms"
)

0 comments on commit f466cf2

Please sign in to comment.