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

Unified Diff: client/cmd/isolate/checker.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/cmd/isolate/checker_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/isolate/checker.go
diff --git a/client/cmd/isolate/checker.go b/client/cmd/isolate/checker.go
index 5e2c159ac6bbd424e7ea6933db99ea2a9b602ea7..397e189637f55cec80e1f845383a62a25a9d19ba 100644
--- a/client/cmd/isolate/checker.go
+++ b/client/cmd/isolate/checker.go
@@ -38,6 +38,7 @@ type checkerItem struct {
// on the server.
// Checker methods are safe to call concurrently.
type Checker struct {
+ ctx context.Context
svc isolateService
bundler *bundler.Bundler
err error
@@ -57,11 +58,12 @@ func (cb *CountBytes) addFile(size int64) {
}
// NewChecker creates a NewChecker with the given isolated client.
-func NewChecker(client *isolatedclient.Client) *Checker {
- return newChecker(client)
+// The provided context is used to make all requests to the isolate server.
+func NewChecker(ctx context.Context, client *isolatedclient.Client) *Checker {
+ return newChecker(ctx, client)
}
-func newChecker(svc isolateService) *Checker {
+func newChecker(ctx context.Context, svc isolateService) *Checker {
c := &Checker{
svc: svc,
}
@@ -116,7 +118,7 @@ func (c *Checker) check(items []checkerItem) error {
IsIsolated: item.isolated,
})
}
- out, err := c.svc.Contains(context.Background(), digests)
+ out, err := c.svc.Contains(c.ctx, digests)
if err != nil {
return err
}
« no previous file with comments | « no previous file | client/cmd/isolate/checker_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698