-
Notifications
You must be signed in to change notification settings - Fork 21
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
Don't display calculating datastore size on empty repo. #37
Comments
We can do this with a timeout. That is, fire off a goroutine: done := make(chan struct{})
cancel := make(chan struct{})
go func() {
defer close(done)
select {
case <-time.After(...):
fmt.Println(...)
case <-cancel:
}
}
// calculate disk usage.
close(cancel)
<-done This way, we only spam the user when it takes more than, e.g., a second. |
We could do that, detecting a new repo is fairly easy though. Just check for the absence of any directories. |
It doesn't have to be a "new" repo. If the process takes, for example, less than 5 seconds there is no reason to bother the user. |
@kevina can you handle this? |
Stebalien
added a commit
to ipfs/kubo
that referenced
this issue
Mar 29, 2018
See: ipfs/go-ds-flatfs#37 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Stebalien
added a commit
to ipfs/kubo
that referenced
this issue
Mar 29, 2018
See: ipfs/go-ds-flatfs#37 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Stebalien
added a commit
to ipfs/kubo
that referenced
this issue
Mar 29, 2018
See: ipfs/go-ds-flatfs#37 License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should detect when a repo was just created (or empty) and avoid displaying this message:
The text was updated successfully, but these errors were encountered: