MCPcopy Create free account
hub / github.com/vercel/examples / update_job

Function update_job

python/celery/worker/store.py:56–69  ·  view source on GitHub ↗
(job_id: str, **updates: Any)

Source from the content-addressed store, hash-verified

54
55
56def update_job(job_id: str, **updates: Any) -> Job | None:
57 job = get_job(job_id)
58 if job is None:
59 return None
60
61 now = time.time()
62 if updates.get("status") == "running" and job.started_at is None:
63 updates.setdefault("started_at", now)
64 if updates.get("status") in {"completed", "failed"}:
65 updates.setdefault("completed_at", now)
66
67 updated = job.model_copy(update=updates)
68 r.set(JOB_KEY.format(job_id), updated.model_dump_json())
69 return updated
70
71
72def clear_jobs() -> int:

Callers 3

enqueue_jobFunction · 0.90
calculate_fibonacciFunction · 0.90
prime_factorizeFunction · 0.90

Calls 3

get_jobFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected