Skip to content

Commit 5a2fab1

Browse files
committed
Reduce computing lock TTL from 600s to 300s for auto-expiry safety
1 parent bb945b2 commit 5a2fab1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

backend/reviews/admin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,10 @@ def review_recap_compute_analysis_view(self, request, review_session_id):
470470
if cached_result is not None:
471471
return JsonResponse(cached_result)
472472

473-
# Use cache.add as a lock to prevent duplicate task dispatch
473+
# Use cache.add as a lock to prevent duplicate task dispatch.
474+
# Short TTL so lock auto-expires if the worker is killed before cleanup.
474475
computing_key = f"{combined_cache_key}:computing"
475-
if cache.add(computing_key, True, timeout=600):
476+
if cache.add(computing_key, True, timeout=300):
476477
compute_recap_analysis.apply_async(
477478
args=[conference.id, combined_cache_key],
478479
kwargs={"force_recompute": force_recompute},

0 commit comments

Comments
 (0)