1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1563 from dotcloud/1073_add_loading_message

* Runtime: Add loading containers message in no debug
This commit is contained in:
Guillaume J. Charmes 2013-08-23 11:20:22 -07:00
commit 8dd3607bd1

View file

@ -207,19 +207,29 @@ func (runtime *Runtime) Destroy(container *Container) error {
} }
func (runtime *Runtime) restore() error { func (runtime *Runtime) restore() error {
wheel := "-\\|/"
if os.Getenv("DEBUG") == "" {
fmt.Printf("Loading containers: ")
}
dir, err := ioutil.ReadDir(runtime.repository) dir, err := ioutil.ReadDir(runtime.repository)
if err != nil { if err != nil {
return err return err
} }
for _, v := range dir { for i, v := range dir {
id := v.Name() id := v.Name()
container, err := runtime.Load(id) container, err := runtime.Load(id)
if i%21 == 0 && os.Getenv("DEBUG") == "" {
fmt.Printf("\b%c", wheel[i%4])
}
if err != nil { if err != nil {
utils.Debugf("Failed to load container %v: %v", id, err) utils.Debugf("Failed to load container %v: %v", id, err)
continue continue
} }
utils.Debugf("Loaded container %v", container.ID) utils.Debugf("Loaded container %v", container.ID)
} }
if os.Getenv("DEBUG") == "" {
fmt.Printf("\bdone.\n")
}
return nil return nil
} }