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

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

Issue 2570433002: client/isolate: correctly propagate context.Context (Closed)
Patch Set: diff from other CL 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 | « no previous file | client/cmd/isolate/checker_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 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 "log" 8 "log"
9 "time" 9 "time"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // NewChecker creates a NewChecker with the given isolated client. 60 // NewChecker creates a NewChecker with the given isolated client.
61 // The provided context is used to make all requests to the isolate server. 61 // The provided context is used to make all requests to the isolate server.
62 func NewChecker(ctx context.Context, client *isolatedclient.Client) *Checker { 62 func NewChecker(ctx context.Context, client *isolatedclient.Client) *Checker {
63 return newChecker(ctx, client) 63 return newChecker(ctx, client)
64 } 64 }
65 65
66 func newChecker(ctx context.Context, svc isolateService) *Checker { 66 func newChecker(ctx context.Context, svc isolateService) *Checker {
67 c := &Checker{ 67 c := &Checker{
68 svc: svc, 68 svc: svc,
69 ctx: ctx,
69 } 70 }
70 c.bundler = bundler.NewBundler(checkerItem{}, func(bundle interface{}) { 71 c.bundler = bundler.NewBundler(checkerItem{}, func(bundle interface{}) {
71 items := bundle.([]checkerItem) 72 items := bundle.([]checkerItem)
72 if c.err != nil { 73 if c.err != nil {
73 for _, item := range items { 74 for _, item := range items {
74 // Drop any more incoming items. 75 // Drop any more incoming items.
75 log.Printf("WARNING dropped %q from Checker", it em.item.Path) 76 log.Printf("WARNING dropped %q from Checker", it em.item.Path)
76 } 77 }
77 return 78 return
78 } 79 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if size := item.item.Size; out[i] == nil { 127 if size := item.item.Size; out[i] == nil {
127 c.Hit.addFile(size) 128 c.Hit.addFile(size)
128 } else { 129 } else {
129 c.Miss.addFile(size) 130 c.Miss.addFile(size)
130 } 131 }
131 132
132 item.callback(item.item, out[i]) 133 item.callback(item.item, out[i])
133 } 134 }
134 return nil 135 return nil
135 } 136 }
OLDNEW
« 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