Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: client/cmd/isolate/batch_archive.go

Issue 2936713003: Sever isolate cmd dependency on Canceler. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/cmd/isolate/archive.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 "os" 10 "os"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if c.defaultFlags.Quiet { 126 if c.defaultFlags.Quiet {
127 prefix = "" 127 prefix = ""
128 } 128 }
129 start := time.Now() 129 start := time.Now()
130 client, err := c.createAuthClient() 130 client, err := c.createAuthClient()
131 if err != nil { 131 if err != nil {
132 return err 132 return err
133 } 133 }
134 ctx := c.defaultFlags.MakeLoggingContext(os.Stderr) 134 ctx := c.defaultFlags.MakeLoggingContext(os.Stderr)
135 arch := archiver.New(ctx, isolatedclient.New(nil, client, c.isolatedFlag s.ServerURL, c.isolatedFlags.Namespace, nil, nil), out) 135 arch := archiver.New(ctx, isolatedclient.New(nil, client, c.isolatedFlag s.ServerURL, c.isolatedFlags.Namespace, nil, nil), out)
136 » common.CancelOnCtrlC(arch) 136 » CancelOnCtrlC(arch)
137 type tmp struct { 137 type tmp struct {
138 *archiver.Item 138 *archiver.Item
139 name string 139 name string
140 } 140 }
141 items := make(chan *tmp, len(args)) 141 items := make(chan *tmp, len(args))
142 var wg sync.WaitGroup 142 var wg sync.WaitGroup
143 for _, arg := range args { 143 for _, arg := range args {
144 wg.Add(1) 144 wg.Add(1)
145 go func(genJsonPath string) { 145 go func(genJsonPath string) {
146 defer wg.Done() 146 defer wg.Done()
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err) 214 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err)
215 return 1 215 return 1
216 } 216 }
217 defer cl.Close() 217 defer cl.Close()
218 if err := c.main(a, args); err != nil { 218 if err := c.main(a, args); err != nil {
219 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err) 219 fmt.Fprintf(a.GetErr(), "%s: %s\n", a.GetName(), err)
220 return 1 220 return 1
221 } 221 }
222 return 0 222 return 0
223 } 223 }
OLDNEW
« no previous file with comments | « client/cmd/isolate/archive.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698