mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 15:52:21 -05:00
fix dead code errors
This commit is contained in:
@@ -359,15 +359,18 @@ def setup_sqlalchemy_events(app):
|
||||
with app.app_context():
|
||||
|
||||
@event.listens_for(db.engine, "connect")
|
||||
def connect():
|
||||
def connect(dbapi_connection, connection_record):
|
||||
current_app.loggger.debug(f"Using {dbapi_connection} {connection_record}")
|
||||
pass
|
||||
|
||||
@event.listens_for(db.engine, "close")
|
||||
def close():
|
||||
def close(dbapi_connection, connection_record):
|
||||
pass
|
||||
|
||||
@event.listens_for(db.engine, "checkout")
|
||||
def checkout(connection_record):
|
||||
def checkout(dbapi_connection, connection_record, connection_proxy):
|
||||
current_app.loggger.debug(f"Using {dbapi_connection} {connection_proxy}")
|
||||
|
||||
try:
|
||||
# this will overwrite any previous checkout_at timestamp
|
||||
connection_record.info["checkout_at"] = time.monotonic()
|
||||
@@ -408,7 +411,7 @@ def setup_sqlalchemy_events(app):
|
||||
)
|
||||
|
||||
@event.listens_for(db.engine, "checkin")
|
||||
def checkin():
|
||||
def checkin(dbapi_connection, connection_record):
|
||||
pass
|
||||
|
||||
|
||||
@@ -448,7 +451,9 @@ def make_task(app):
|
||||
)
|
||||
)
|
||||
|
||||
def on_failure(self, exc, task_id, args, kwargs):
|
||||
def on_failure(self, exc, task_id, args, kwargs, einfo):
|
||||
current_app.loggger.debug(f"Using {einfo}")
|
||||
|
||||
# enables request id tracing for these logs
|
||||
with self.app_context():
|
||||
app.logger.exception(
|
||||
|
||||
Reference in New Issue
Block a user