-
Notifications
You must be signed in to change notification settings - Fork 29
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
[PB-3237] feat/add folder creation queue #1419
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the stats that show an improvement over the current implementation to the description?
folderQueue.drain(checkCompletion); | ||
filesQueue.drain(checkCompletion); | ||
|
||
levels.forEach(async (level) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why async
without await
? forEach
is sequential, so unless you are planning to do a Promise.all
or something like that, this is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I have already removed it.
Regarding the stats I have put a comment in jira
https://inxt.atlassian.net/browse/PB-3236?focusedCommentId=32663
@@ -959,9 +959,7 @@ const uploadItems = async (props: DriveExplorerProps, rootList: IRoot[], files: | |||
onSuccess: onDragAndDropEnd, | |||
}, | |||
})); | |||
dispatch(storageThunks.uploadMultipleFolderThunkNoCheck(folderDataToUpload)).then(() => { | |||
dispatch(fetchSortedFolderContentThunk(currentFolderId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this no longer necessary for the folder to be displayed in order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is needed but I had to move it inside uploadMultipleFolderThunkNoCheck
.unwrap() | ||
.then(() => { | ||
alreadyUploaded += level.files.length; | ||
alreadyUploaded += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this +1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I have not made any changes, it is used to calculate the progress of uploaded files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if the code didn't change in that part, we can take advantage of the task and refactor this line with alreadyUploaded += level.files.length + 1;
to keep the code cleaner
} | ||
}; | ||
|
||
const checkCompletion = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this function need to be async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not now, I remove it, thanks!
Quality Gate failedFailed conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take advantage of the task and add tests to this functionality
Description
Added a folder creation queue that creates folders in parallel to the files, so file uploads are not stuck waiting for folder creations
Related Issues
Related Pull Requests
Checklist
How Has This Been Tested?
Additional Notes