async def _periodically_serialize(self, random: Random):
    while (not self.is_closed):
        if (self.address_manager is None):
            (await asyncio.sleep(10))
            continue
        serialize_interval = random.randint((15 * 60), (30 * 60))
        (await asyncio.sleep(serialize_interval))
        async with self.address_manager.lock:
            (await self.address_manager_store.serialize(self.address_manager))
async def _periodically_serialize(self, random: Random):
    while (not self.is_closed):
        if (self.address_manager is None):
            (await asyncio.sleep(10))
            continue
        serialize_interval = random.randint((15 * 60), (30 * 60))
        (await asyncio.sleep(serialize_interval))
        async with self.address_manager.lock:
            (await self.address_manager_store.serialize(self.address_manager))