mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 00:06:16 -04:00
dead code findings?
This commit is contained in:
@@ -359,15 +359,15 @@ def setup_sqlalchemy_events(app):
|
|||||||
with app.app_context():
|
with app.app_context():
|
||||||
|
|
||||||
@event.listens_for(db.engine, "connect")
|
@event.listens_for(db.engine, "connect")
|
||||||
def connect(dbapi_connection, connection_record):
|
def connect():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@event.listens_for(db.engine, "close")
|
@event.listens_for(db.engine, "close")
|
||||||
def close(dbapi_connection, connection_record):
|
def close():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@event.listens_for(db.engine, "checkout")
|
@event.listens_for(db.engine, "checkout")
|
||||||
def checkout(dbapi_connection, connection_record, connection_proxy):
|
def checkout(connection_record):
|
||||||
try:
|
try:
|
||||||
# this will overwrite any previous checkout_at timestamp
|
# this will overwrite any previous checkout_at timestamp
|
||||||
connection_record.info["checkout_at"] = time.monotonic()
|
connection_record.info["checkout_at"] = time.monotonic()
|
||||||
@@ -408,7 +408,7 @@ def setup_sqlalchemy_events(app):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@event.listens_for(db.engine, "checkin")
|
@event.listens_for(db.engine, "checkin")
|
||||||
def checkin(dbapi_connection, connection_record):
|
def checkin():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ def make_task(app):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def on_failure(self, exc, task_id, args, kwargs, einfo):
|
def on_failure(self, exc, task_id, args, kwargs):
|
||||||
# enables request id tracing for these logs
|
# enables request id tracing for these logs
|
||||||
with self.app_context():
|
with self.app_context():
|
||||||
app.logger.exception(
|
app.logger.exception(
|
||||||
|
|||||||
Reference in New Issue
Block a user