async def maintain_db(self):
    (await self.channel_db.data_loaded.wait())
    while True:
        if (len(self.unknown_ids) == 0):
            self.channel_db.prune_old_policies(self.max_age)
            self.channel_db.prune_orphaned_channels()
        (await asyncio.sleep(120))
async def maintain_db(self):
    (await self.channel_db.data_loaded.wait())
    while True:
        if (len(self.unknown_ids) == 0):
            self.channel_db.prune_old_policies(self.max_age)
            self.channel_db.prune_orphaned_channels()
        (await asyncio.sleep(120))