Code Room
Code reviewHard
Question
Review this Python distributed-lock usage (Redis SETNX-style).
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
def process_job(job_id): lock = redis.set(f"lock:{job_id}", "1", nx=True) if not lock: return try: do_work(job_id) finally: redis.delete(f"lock:{job_id}")Run or narrate your approach, then ask the coach.