From 8cc8ca002c1a6e0531114a6cf1e754302248afd3 Mon Sep 17 00:00:00 2001 From: Oliver Newland Date: Tue, 1 Oct 2024 09:34:08 -0700 Subject: [PATCH] method rename --- snuba/manual_jobs/runner.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/snuba/manual_jobs/runner.py b/snuba/manual_jobs/runner.py index 030d1d8360..a6fef33607 100644 --- a/snuba/manual_jobs/runner.py +++ b/snuba/manual_jobs/runner.py @@ -63,33 +63,33 @@ def _build_job_spec_from_entry(content: Any) -> JobSpec: return job_spec -def _job_lock_key(job_id: str) -> str: +def _build_job_lock_key(job_id: str) -> str: return f"snuba:manual_jobs:{job_id}:lock" -def _job_status_key(job_id: str) -> str: +def _build_job_status_key(job_id: str) -> str: return f"snuba:manual_jobs:{job_id}:execution_status" def _acquire_job_lock(job_id: str) -> bool: return bool( _redis_client.set( - name=_job_lock_key(job_id), value=1, nx=True, ex=(24 * 60 * 60) + name=_build_job_lock_key(job_id), value=1, nx=True, ex=(24 * 60 * 60) ) ) def _release_job_lock(job_id: str) -> None: - _redis_client.delete(_job_lock_key(job_id)) + _redis_client.delete(_build_job_lock_key(job_id)) def _set_job_status(job_id: str, status: JobStatus) -> JobStatus: - _redis_client.set(name=_job_status_key(job_id), value=status.value) + _redis_client.set(name=_build_job_status_key(job_id), value=status.value) return status def get_job_status(job_id: str) -> Optional[JobStatus]: - redis_status = _redis_client.get(name=_job_status_key(job_id)) + redis_status = _redis_client.get(name=_build_job_status_key(job_id)) if redis_status is None: return redis_status else: