Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodejs server file's async problem #300

Closed
vG5YtZQN opened this issue Mar 14, 2018 · 1 comment
Closed

nodejs server file's async problem #300

vG5YtZQN opened this issue Mar 14, 2018 · 1 comment

Comments

@vG5YtZQN
Copy link

in packge/connectors/nodejs/fillmanager.js file
in some case
when readfolder run at if($index>=loopInfo.total) it will not response all the files in file server'folder

because the async fs.stat function does't finnish read file info inorder

for fix the bug

use the follow code replace
loopInfo[$index] = true;
if(isAllFinish(loopInfo)){
callback(loopInfo.results)
}

function isAllFinish(l){
for(var i=0;i<l.total;i++){
if(!l.status[i])
return false;
}
return true;
}

or you can use Promise fix the Bug

@psolom
Copy link
Owner

psolom commented Mar 14, 2018

Yeah, this connector may be outdated.
Thanks for the fix.

Btw, you can try this one:
https://github.com/dekyfin/RichFilemanager-NODE

Let me know how it works for you please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants