Reduce debugf frequency to avoid terminal freeze

This commit is contained in:
Guillaume J. Charmes 2013-11-25 12:06:16 -08:00
parent d47d49a2f9
commit 78d2e2dc37
No known key found for this signature in database
GPG Key ID: B33E4642CB6E3FF3
1 changed files with 7 additions and 2 deletions

View File

@ -650,10 +650,13 @@ func (devices *DeviceSet) waitRemove(hash string) error {
// The error might actually be something else, but we can't differentiate.
return nil
}
utils.Debugf("Waiting for removal of %s: exists=%d", devname, devinfo.Exists)
if i%100 == 0 {
utils.Debugf("Waiting for removal of %s: exists=%d", devname, devinfo.Exists)
}
if devinfo.Exists == 0 {
break
}
time.Sleep(1 * time.Millisecond)
}
if i == 1000 {
@ -676,7 +679,9 @@ func (devices *DeviceSet) waitClose(hash string) error {
if err != nil {
return err
}
utils.Debugf("Waiting for unmount of %s: opencount=%d", devname, devinfo.OpenCount)
if i%100 == 0 {
utils.Debugf("Waiting for unmount of %s: opencount=%d", devname, devinfo.OpenCount)
}
if devinfo.OpenCount == 0 {
break
}