Configure all the workspaces in parallel to help with startup times. Change-Id: I41f6c853ffc4994c8acb940920b34ecc36464022
diff --git a/fs/multifs.go b/fs/multifs.go index b039f19..b738de2 100644 --- a/fs/multifs.go +++ b/fs/multifs.go
@@ -19,6 +19,7 @@ "log" "os" "path/filepath" + "sync" "github.com/google/slothfs/cache" "github.com/google/slothfs/gitiles" @@ -46,10 +47,17 @@ } log.Println("configuring workspaces...") + var wg sync.WaitGroup + wg.Add(len(fs)) for _, f := range fs { - _, code := c.Symlink(filepath.Base(f), f, nil) - log.Printf("manifest %s: %v", f, code) + go func(n string) { + _, code := c.Symlink(filepath.Base(n), n, nil) + log.Printf("manifest %s: %v", n, code) + wg.Done() + }(f) } + wg.Wait() + return nil }