FF: Document finder reads directory randomly #486
Labels
Needs Further Investigation
Get ready for sleepless nights, unlimited coffee to find issue was a missing comma
P4
To please someone or myself I have opened this issue. Will be fixed before boomers go extinct
Milestone
findDocuments method in DocumentFinder.php uses readdir, this function does not sort but instead reads the dir as the files were stored. This is fine if we are looking for multiple files as then we can sort them later. But, if we use findOneBy(), it randomly picks the last modified file, which is not good. We can use scandir instead so we have sorting of files before we run through them.
######## Issue imported from Gitea ########
Details
Gitea Issue ID : 550
State : open
Created : 2024-05-15T21:42:53+10:00
Issue Description
findDocuments method in DocumentFinder.php uses readdir, this function does not sort but instead reads the dir as the files were stored. This is fine if we are looking for multiple files as then we can sort them later. But, if we use findOneBy(), it randomly picks the last modified file, which is not good. We can use scandir instead so we have sorting of files before we run through them.
Timeline
Label : Added P4 on 2024-05-15T21:42:53+10:00.
Label : Added Needs Further Investigation on 2024-05-15T21:42:53+10:00.
The text was updated successfully, but these errors were encountered: