KnowledgeCanvas / knowledge

Knowledge is a tool for saving, searching, accessing, exploring and chatting with all of your favorite websites, documents and files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Autoscan moves file before it is completely downloaded

RobRoyce opened this issue · comments

Currently, when a large file is being downloaded and Autoscan is triggered, the app will move the partially downloaded file to the pending folder, causing the download to fail and file to be partial.

Desired behavior: wait for the download to complete before ever processing the file.

Just FYI, on Windows this is not an issue. An error is still thrown, but since Windows has file locking, the autoscan service is prevented from moving the file until it is completely downloaded and unlocked. Whereas on UNIX style systems you are able to move files regardless of what other processes may be using them.

On Windows it produces an EBUSY error, and it will simply continue to occur until the file is unlocked, which will only happen when the file is done being downloaded. At that point, when the autoscan service is actually able to move it, there is no issue and the file is successfully moved to the pending folder.