Return True when another worker holds the task lock (read-only check).
(task_name, id)
| 312 | |
| 313 | |
| 314 | def is_task_lock_held(task_name, id): |
| 315 | """Return True when another worker holds the task lock (read-only check).""" |
| 316 | redis_client = RedisClient.get_client() |
| 317 | if redis_client is None: |
| 318 | return False |
| 319 | lock_id = f"task_lock_{task_name}_{id}" |
| 320 | return bool(redis_client.exists(lock_id)) |
| 321 | |
| 322 | |
| 323 | class TaskLockRenewer: |
no test coverage detected