mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-05 08:40:29 -04:00
cleanup redis commands and flow
This commit is contained in:
@@ -803,9 +803,11 @@ def dao_close_out_delivery_receipts():
|
||||
|
||||
|
||||
def dao_batch_insert_notifications(batch):
|
||||
current_app.logger.info("DOING BATCH INSERT IN DAO")
|
||||
try:
|
||||
db.session.bulk_save_objects(Notification(**msg) for msg in batch)
|
||||
db.session.bulk_save_objects(batch)
|
||||
db.session.commit()
|
||||
current_app.logger.info(f"SUCCESSFULLY INSERTED: {len(batch)}")
|
||||
return len(batch)
|
||||
except sqlalchemy.exc.SQLAlchemyError as e:
|
||||
current_app.logger.exception(f"Error during batch insert {e}")
|
||||
|
||||
Reference in New Issue
Block a user