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

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

Issue 2551973004: client/isolate: add context to NewChecker func (Closed)
Patch Set: Rebase Created 4 years 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/checker_test.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 "context" 8 "context"
9 "encoding/json" 9 "encoding/json"
10 "errors" 10 "errors"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Create the isolated client which connects to the isolate server. 88 // Create the isolated client which connects to the isolate server.
89 authCl, err := c.createAuthClient() 89 authCl, err := c.createAuthClient()
90 if err != nil { 90 if err != nil {
91 return err 91 return err
92 } 92 }
93 client := isolatedclient.New(nil, authCl, c.isolatedFlags.ServerURL, c.i solatedFlags.Namespace, nil) 93 client := isolatedclient.New(nil, authCl, c.isolatedFlags.ServerURL, c.i solatedFlags.Namespace, nil)
94 94
95 // Set up a checker and pair of uploaders. One uploader is for in-memory 95 // Set up a checker and pair of uploaders. One uploader is for in-memory
96 // files, and one is for on-disk files (we want to limit the latter to o nly 96 // files, and one is for on-disk files (we want to limit the latter to o nly
97 // one upload at a time). 97 // one upload at a time).
98 » // TODO(djd): Make NewChecker take a context arg. 98 » checker := NewChecker(ctx, client)
99 » checker := NewChecker(client)
100 memUploader, fileUploader := NewUploader(ctx, client, 10), NewUploader(c tx, client, 1) 99 memUploader, fileUploader := NewUploader(ctx, client, 10), NewUploader(c tx, client, 1)
101 100
102 // Walk each of the deps, partioning the results into symlinks and files categorised by size. 101 // Walk each of the deps, partioning the results into symlinks and files categorised by size.
103 var links, archiveFiles, indivFiles []*Item 102 var links, archiveFiles, indivFiles []*Item
104 var archiveSize, indivSize int64 // Cumulative size of archived/individu al files. 103 var archiveSize, indivSize int64 // Cumulative size of archived/individu al files.
105 for _, dep := range deps { 104 for _, dep := range deps {
106 // Try to walk dep. If dep is a file (or symlink), the inner fun ction is called exactly once. 105 // Try to walk dep. If dep is a file (or symlink), the inner fun ction is called exactly once.
107 err := filepath.Walk(filepath.Clean(dep), func(path string, info os.FileInfo, err error) error { 106 err := filepath.Walk(filepath.Clean(dep), func(path string, info os.FileInfo, err error) error {
108 if err != nil { 107 if err != nil {
109 return err 108 return err
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 func eventlogEndpoint(endpointFlag string) string { 335 func eventlogEndpoint(endpointFlag string) string {
337 switch endpointFlag { 336 switch endpointFlag {
338 case "test": 337 case "test":
339 return eventlog.TestEndpoint 338 return eventlog.TestEndpoint
340 case "prod": 339 case "prod":
341 return eventlog.ProdEndpoint 340 return eventlog.ProdEndpoint
342 default: 341 default:
343 return endpointFlag 342 return endpointFlag
344 } 343 }
345 } 344 }
OLDNEW
« no previous file with comments | « client/cmd/isolate/checker_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698