mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 21:46:44 +00:00
Check for the precise return value
`task.locked_by_pid_running()` returns: - `True`: locked and PID exists - `False`: locked and PID does not exist - `None`: not locked_by, no PID to check
This commit is contained in:
parent
a7f872e902
commit
96f1618168
@ -826,7 +826,11 @@ class TasksView(ListView):
|
|||||||
for task in queryset:
|
for task in queryset:
|
||||||
# There is broken logic in Task.objects.locked(), work around it.
|
# There is broken logic in Task.objects.locked(), work around it.
|
||||||
# Without this, the queue never resumes properly.
|
# Without this, the queue never resumes properly.
|
||||||
if task.locked_by and not task.locked_by_pid_running():
|
# `task.locked_by_pid_running()` returns:
|
||||||
|
# - True: locked and PID exists
|
||||||
|
# - False: locked and PID does not exist
|
||||||
|
# - None: not locked_by, no PID to check
|
||||||
|
if task.locked_by_pid_running() is False:
|
||||||
task.locked_by = None
|
task.locked_by = None
|
||||||
# do not wait for the task to expire
|
# do not wait for the task to expire
|
||||||
task.locked_at = None
|
task.locked_at = None
|
||||||
|
Loading…
Reference in New Issue
Block a user