This replaces a loop over all tasks with one that fetches only pending tasks, as determined by the working set.
This should be faster for task DB's with large numbers of completed tasks, although on my medium-sized installation (~5000 total tasks) the difference is negligible.
This replaces a loop over all tasks with one that fetches only pending tasks, as determined by the working set.
This should be faster for task DB's with large numbers of completed tasks, although on my medium-sized installation (~5000 total tasks) the difference is negligible.
Fixes #3632.