#105217RecyclerGarbageCollectionTask does not work recursively and stops at first sight
Description
The RecyclerGarbageCollectionTask from ext:scheduler to cleanup file storage recycle folders (_recycler_, ROLE_RECYCLER) does not detect these recycle folders recursively, but only on first level (of the file storage root). Having them in sub-folders is totally possible (when using file mounts on subfolders, for example). And it also stops at first sight (there can validly be multiple recyclers, however).
$rootLevelFolder->getSubfolders() (which is used by the task to find the recycler folders) does allow setting an argument $recursive = true.
Reviews 3
History 511
-
Garvin Hicking changed category <span data-processor="relativetime" data-value="2024-10-07T14:21:33+00:00" > 10/07/24, 14:21 </span>
-
S P changed subject
RecyclerGarbageCollectionTask does not work recursivelyRecyclerGarbageCollectionTask does not work recursively and stops at first sight description <span data-processor="relativetime" data-value="2024-10-08T07:48:22+00:00" > 10/08/24, 07:48 </span> -
Sébastien Delcroix commented <span data-processor="relativetime" data-value="2024-10-08T08:38:28+00:00" > 10/08/24, 08:38 </span>
@stefanp
Could you please also test your changes with
_recycler_folders nested inside other_recycler_folders if it crashes ? -
Gerrit Code Review pushed patch set 1 for main to change 86502 status
NewUnder Review <span data-processor="relativetime" data-value="2024-10-08T08:46:22+00:00" > 10/08/24, 08:46 </span> -
Gerrit Code Review pushed patch set 2 for main to change 86502 <span data-processor="relativetime" data-value="2024-10-18T14:00:10+00:00" > 10/18/24, 14:00 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 86502 <span data-processor="relativetime" data-value="2024-12-17T18:45:31+00:00" > 12/17/24, 18:45 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96407 <span data-processor="relativetime" data-value="2026-10-06T08:21:15+00:00" > 10/06/26, 08:21 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 96407 <span data-processor="relativetime" data-value="2026-10-06T08:42:47+00:00" > 10/06/26, 08:42 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96410 <span data-processor="relativetime" data-value="2026-10-06T11:09:12+00:00" > 10/06/26, 11:09 </span>
-
Oliver Bartsch commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-06T11:15:11+00:00" > 10/06/26, 11:15 </span>Applied in changeset commit:cbbc97eb2256c4c359abecdda1f3dd157209399c.
Got some time to test this out. Two changes needed:
The inner loop must be (note the
trueargument at the end):(not sure about the filters, I just disabled them, because inside the loop the folders are selected for recycler folders anyways)
And the
breakinside the inner loop must be removed, so that it actually loops over all folders.These both steps let the task cleanup all recycle bins, just like one expects from this task.
Or to put it all together, this is how the loop looks now in the patched RecyclerGarbageCollectionTask in my project: