fix dead code errors

This commit is contained in:
Kenneth Kehl
2025-07-24 10:35:33 -07:00
parent 378dfc3221
commit daf490d308

View File

@@ -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(