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

number of files/directories not shown correctly #9

Closed
benglitz opened this issue Jan 2, 2023 · 4 comments
Closed

number of files/directories not shown correctly #9

benglitz opened this issue Jan 2, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@benglitz
Copy link

benglitz commented Jan 2, 2023

It would be more intuitive, if repocli first collected the count of all files/total amount of data to be transferred, and then correspondingly labelled the progressbar. Currently, one has little prediction of how long the upload will take before finishing.

@hurngchunlee hurngchunlee added the enhancement New feature or request label Jan 2, 2023
@hurngchunlee
Copy link
Member

Currently the total data size and number of files are counted when making directory walk through at the transfer source. Files in the visited (sub-)directories are put into a queue (i.e. GO channel) and carried out by four worker threads to process the transfer immediately.

The reason of such implementation is to avoid additional directory walk through just for counting the data size and number of files to be transferred, and to have the transfer takes place without waiting until the end of the counting.

However, because the queue is unbuffered, only up to four sub-directories can be visited at the time, which blocks the update of the counter. I believe it is the reason causing the progress bar looks rather unpredictable.

As a workaround, I have changed to use the buffered channel (with buffer size of 1M files). If there are less than 1M files involved in the transfer, this should make the counter updated faster while still doesn't need an extra directory walk to get the total data size and number of files.

@hurngchunlee
Copy link
Member

@benglitz I wonder if you see improvement with this workaround.

@benglitz
Copy link
Author

Yes, it has definitely improved! Thanks for implementing the workaround.

@hurngchunlee
Copy link
Member

Thanks @benglitz I am closing this issue.

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

No branches or pull requests

2 participants