mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 03:08:41 +08:00

A race condition issue is possible when multiple thread/processes are calling this method. `ls` prints out to stderr "cannot access '...': No such file or directory" if any of the files it's currently trying to list are being removed by the `xargs rm -rf` in an another process. That doesn't affect the result, but it did raise an error before this change. Tested on a production instance where the original issue was observed. Co-Authored-By: Régis Hanol <regis@hanol.fr>