async def check_status(job: Job) -> str: await asyncio.sleep(JOB_REFRESH_PERIOD) try: job.refresh() except NoSuchJobError: jobs[job.id] = None return job.id
def job(cls, id): cls.connect() job = Job(id) try: job.refresh() except Exception: pass return serialize_job(job)