async def main(): try: await asyncio.wait_for(export_batch(), timeout=30) except TimeoutError: print("batch export timed out after 30 seconds")