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

Unified Diff: golden/go/filediffstore/filediffstore.go

Issue 884943003: Ignore traces (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « golden/go/diff/diff.go ('k') | golden/go/skiacorrectness/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: golden/go/filediffstore/filediffstore.go
diff --git a/golden/go/filediffstore/filediffstore.go b/golden/go/filediffstore/filediffstore.go
index d791e729d1594e1dbeb9c17a6137aa27b370f0f9..bd5c37c8a0c923128602e4546fdcd9cf998f1493 100644
--- a/golden/go/filediffstore/filediffstore.go
+++ b/golden/go/filediffstore/filediffstore.go
@@ -112,14 +112,14 @@ type FileDiffStore struct {
absPathCh chan *WorkerReq
getCh chan *WorkerReq
- // ignoreableDigests contains the digests that should be ignored.
- ignorableDigests map[string]bool
+ // unavailableDigests contains the digests that should be ignored.
+ unavailableDigests map[string]bool
- // idChan is a channel to add to ignorableDigests.
- ignorableChan chan string
+ // idChan is a channel to add to unavailableDigests.
+ unavailableChan chan string
- // Mutex for the ignorable Channel
- ignorableMutex sync.Mutex
+ // unavailableMutex protects unavailableDigests
+ unavailableMutex sync.Mutex
// Mutexes for ensuring safe access to the different local caches.
diffDirLock sync.Mutex
@@ -151,7 +151,7 @@ func NewFileDiffStore(client *http.Client, baseDir, gsBucketName string, storage
}
diffCache := cacheFactory("di", DiffMetricsCodec(0))
- ignorableChan := make(chan string, 10)
+ unavailableChan := make(chan string, 10)
fs := &FileDiffStore{
client: client,
@@ -163,22 +163,22 @@ func NewFileDiffStore(client *http.Client, baseDir, gsBucketName string, storage
storageBaseDir: storageBaseDir,
imageCache: imageCache,
diffCache: diffCache,
- ignorableDigests: map[string]bool{},
- ignorableChan: ignorableChan,
+ unavailableDigests: map[string]bool{},
+ unavailableChan: unavailableChan,
}
// TODO(stephana): Clean this up and store digests to ignore in the
// database and expose them on the front-end.
// This is the hash of the empty, we should ignore this right away.
- ignorableChan <- "d41d8cd98f00b204e9800998ecf8427e"
+ unavailableChan <- "d41d8cd98f00b204e9800998ecf8427e"
go func() {
var ignoreDigest string
for {
- ignoreDigest = <-ignorableChan
+ ignoreDigest = <-unavailableChan
func() {
- fs.ignorableMutex.Lock()
- defer fs.ignorableMutex.Unlock()
- fs.ignorableDigests[ignoreDigest] = true
+ fs.unavailableMutex.Lock()
+ defer fs.unavailableMutex.Unlock()
+ fs.unavailableDigests[ignoreDigest] = true
}()
}
}()
@@ -402,12 +402,12 @@ func (fs *FileDiffStore) AbsPath(digests []string) map[string]string {
}
}
-// IgnorableDigests is part of the diff.DiffStore interface. See details there.
-func (fs *FileDiffStore) IgnorableDigests() map[string]bool {
- fs.ignorableMutex.Lock()
- defer fs.ignorableMutex.Unlock()
- result := make(map[string]bool, len(fs.ignorableDigests))
- for k, v := range fs.ignorableDigests {
+// UnavailableDigests is part of the diff.DiffStore interface. See details there.
+func (fs *FileDiffStore) UnavailableDigests() map[string]bool {
+ fs.unavailableMutex.Lock()
+ defer fs.unavailableMutex.Unlock()
+ result := make(map[string]bool, len(fs.unavailableDigests))
+ for k, v := range fs.unavailableDigests {
result[k] = v
}
return result
@@ -659,7 +659,7 @@ func (fs *FileDiffStore) getDigestImage(d string) (image.Image, error) {
}
// Mark the image as ignorable since we were not able to decode it.
- fs.ignorableChan <- d
+ fs.unavailableChan <- d
return nil, fmt.Errorf("Unable to read image for %s: %s", d, err)
}
« no previous file with comments | « golden/go/diff/diff.go ('k') | golden/go/skiacorrectness/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698