diff --git a/tubesync/sync/views.py b/tubesync/sync/views.py index bd2f139d..9b921283 100644 --- a/tubesync/sync/views.py +++ b/tubesync/sync/views.py @@ -824,12 +824,13 @@ class TasksView(ListView): queryset = self.get_queryset() now = timezone.now() for task in queryset: - # There is broken logic in Task.objects.locked(), work around it. - # Without this, the queue never resumes properly. + # There was broken logic in `Task.objects.locked()`, work around it. + # With that broken logic, the tasks never resume properly. + # This check unlocks the tasks without a running process. # `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 + # - `True`: locked and PID exists + # - `False`: locked and PID does not exist + # - `None`: not `locked_by`, so there was no PID to check if task.locked_by_pid_running() is False: task.locked_by = None # do not wait for the task to expire