diff --git a/tanner/session_manager.py b/tanner/session_manager.py index 8d3e613e..360c8b89 100644 --- a/tanner/session_manager.py +++ b/tanner/session_manager.py @@ -71,7 +71,8 @@ async def delete_old_sessions(self, redis_client): if not sess.is_expired(): continue await sess.remove_associated_db() - await sess.remove_associated_env() + if sess.associated_env is not None: + await sess.remove_associated_env() self.sessions.remove(sess) try: await redis_client.set(sess.get_uuid(), sess.to_json())