mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-14 01:02:09 -05:00
fix logger.exception syntax
when given any log function with multiple parameters, the python logging utils assume the first param is a format string and the rest are arguments to pass in - we were passing in the exception object to `logger.exception`, however, the purpose of .exception is to add the exception object itself - so we didn't need to
This commit is contained in:
@@ -31,7 +31,7 @@ def run_scheduled_jobs():
|
||||
process_job.apply_async([str(job.id)], queue="process-job")
|
||||
current_app.logger.info("Job ID {} added to process job queue".format(job.id))
|
||||
except SQLAlchemyError as e:
|
||||
current_app.logger.exception("Failed to run scheduled jobs", e)
|
||||
current_app.logger.exception("Failed to run scheduled jobs")
|
||||
raise
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ def delete_verify_codes():
|
||||
"Delete job started {} finished {} deleted {} verify codes".format(start, datetime.utcnow(), deleted)
|
||||
)
|
||||
except SQLAlchemyError as e:
|
||||
current_app.logger.exception("Failed to delete verify codes", e)
|
||||
current_app.logger.exception("Failed to delete verify codes")
|
||||
raise
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ def delete_successful_notifications():
|
||||
)
|
||||
)
|
||||
except SQLAlchemyError as e:
|
||||
current_app.logger.exception("Failed to delete successful notifications", e)
|
||||
current_app.logger.exception("Failed to delete successful notifications")
|
||||
raise
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ def delete_failed_notifications():
|
||||
)
|
||||
)
|
||||
except SQLAlchemyError as e:
|
||||
current_app.logger.exception("Failed to delete failed notifications", e)
|
||||
current_app.logger.exception("Failed to delete failed notifications")
|
||||
raise
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ def delete_invitations():
|
||||
"Delete job started {} finished {} deleted {} invitations".format(start, datetime.utcnow(), deleted)
|
||||
)
|
||||
except SQLAlchemyError as e:
|
||||
current_app.logger.exception("Failed to delete invitations", e)
|
||||
current_app.logger.exception("Failed to delete invitations")
|
||||
raise
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user