fix: typing fixes since moving to Mapped types in models

This commit is contained in:
Iain Learmonth 2024-11-09 11:09:44 +00:00
parent d08388c339
commit 4693e994ba
5 changed files with 71 additions and 44 deletions

View file

@ -127,6 +127,8 @@ class BridgeMetaAutomation(BaseAutomation):
).all()
logging.debug("Found %s deprecated bridges", len(deprecated_bridges))
for bridge in deprecated_bridges:
if bridge.deprecated is None:
continue # Possible due to SQLAlchemy lazy loading
cutoff = datetime.datetime.utcnow() - datetime.timedelta(hours=bridge.conf.expiry_hours)
if bridge.deprecated < cutoff:
logging.debug("Destroying expired bridge")