Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout to index plays lock #912

Merged
merged 2 commits into from
Oct 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions discovery-provider/src/tasks/index_plays.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ def update_play_count(self):
# Define lock acquired boolean
have_lock = False

# Define redis lock object
update_lock = redis.lock("update_play_count_lock", blocking_timeout=25)
# Define redis lock object with a timeout of 10 minutes
update_lock = redis.lock("update_play_count_lock", timeout=10*60)
try:
# Attempt to acquire lock - do not block if unable to acquire
have_lock = update_lock.acquire(blocking=False)
Expand Down