Deactivate lock regardless of error

This commit is contained in:
Zeva Rose 2022-04-19 13:59:30 -06:00
parent 7dcfd1aaf7
commit 4a69655bfb

View file

@ -27,9 +27,9 @@ async def _unlock(channel: GuildChannel, lock: Lock, logger: Logger) -> None:
await channel.delete_permission(target=overwrite, reason="Automatic unlock") await channel.delete_permission(target=overwrite, reason="Automatic unlock")
else: else:
logger.debug("Permission neither exists not existed") logger.debug("Permission neither exists not existed")
lock.active = False
except Exception: except Exception:
logger.debug("Locked channel deleted, ignoring error") logger.debug("Locked channel deleted, ignoring error")
lock.active = False
await lock.commit() await lock.commit()