mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
don't log if we dont delete anything for a service
we try and delete for lots of services. this includes services that don't actually have anything to delete that day. that might be because they had a custom data retention so we always go to check them, or because they only sent test notifications (which we'll delete but not include in the count in the log line). we don't really need to see log lines saying that we didn't delete anything for that service - that's just a long list of boring log messages that will hide the actual interesting stuff - which services we did delete content for.
This commit is contained in:
@@ -136,14 +136,15 @@ def delete_notifications_for_service_and_type(service_id, notification_type, dat
|
||||
service_id,
|
||||
datetime_to_delete_before,
|
||||
)
|
||||
end = datetime.utcnow()
|
||||
current_app.logger.info(
|
||||
f'delete-notifications-for-service-and-type: '
|
||||
f'service: {service_id}, '
|
||||
f'notification_type: {notification_type}, '
|
||||
f'count deleted: {num_deleted}, '
|
||||
f'duration: {(end - start).seconds} seconds'
|
||||
)
|
||||
if num_deleted:
|
||||
end = datetime.utcnow()
|
||||
current_app.logger.info(
|
||||
f'delete-notifications-for-service-and-type: '
|
||||
f'service: {service_id}, '
|
||||
f'notification_type: {notification_type}, '
|
||||
f'count deleted: {num_deleted}, '
|
||||
f'duration: {(end - start).seconds} seconds'
|
||||
)
|
||||
|
||||
|
||||
@notify_celery.task(name='timeout-sending-notifications')
|
||||
|
||||
Reference in New Issue
Block a user