Пример #1
0
async def get_job(id: str):
    job = Job(id)

    if (job.exists() == False):
        raise HTTPException(status_code=404, detail="job not found")
    else:
        return parseJson(job)
Пример #2
0
async def run_job(id: str):
    job = Job(id)
    if not job.exists():
        raise HTTPException(status_code=404,
                            detail="job not found or already claimed")
    worker = Worker()
    worker.execJob(job)
    return {"status": "success"}