you should avoid `continue` as much as possible without bloating code with flags. here it's should be done like
```
if lock:
    self._remove_running(lock, task_id)