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

Unified Diff: client/cmd/isolate/exp_archive.go

Issue 2991503002: isolate: Finalize the isolate in UploadTracker (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | client/cmd/isolate/upload_tracker.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/isolate/exp_archive.go
diff --git a/client/cmd/isolate/exp_archive.go b/client/cmd/isolate/exp_archive.go
index 7e1491f0f2edc06706ec30f3b87fbebe3d4ee86f..d20854b036a8da611a12b4f34d8719047320ee94 100644
--- a/client/cmd/isolate/exp_archive.go
+++ b/client/cmd/isolate/exp_archive.go
@@ -15,14 +15,11 @@
package main
import (
- "encoding/json"
"errors"
"fmt"
- "io/ioutil"
"log"
"os"
"path/filepath"
- "strings"
"time"
humanize "github.com/dustin/go-humanize"
@@ -217,46 +214,11 @@ func (c *expArchiveRun) main() error {
return err
}
- isolItem, isolJSON, err := tracker.Finalize(archiveOpts.Isolated)
+ isolDigest, err := tracker.Finalize(archiveOpts.Isolated, c.dumpJSON)
if err != nil {
return err
}
- // Make sure that all pending items have been checked.
- if err := checker.Close(); err != nil {
- return err
- }
-
- // Make sure that all the uploads have completed successfully.
- if err := uploader.Close(); err != nil {
- return err
- }
-
- // Write the isolated file, and emit its digest to stdout.
- if err := ioutil.WriteFile(archiveOpts.Isolated, isolJSON, 0644); err != nil {
- return err
- }
- fmt.Printf("%s\t%s\n", isolItem.Digest, filepath.Base(archiveOpts.Isolated))
-
- // Optionally, write the digest of the isolated file as JSON (in the same
- // format as batch_archive).
- if c.dumpJSON != "" {
- // The name is the base name of the isolated file, extension stripped.
- name := filepath.Base(archiveOpts.Isolated)
- if i := strings.LastIndex(name, "."); i != -1 {
- name = name[:i]
- }
- j, err := json.Marshal(map[string]isolated.HexDigest{
- name: isolItem.Digest,
- })
- if err != nil {
- return err
- }
- if err := ioutil.WriteFile(c.dumpJSON, j, 0644); err != nil {
- return err
- }
- }
-
end := time.Now()
archiveDetails := &logpb.IsolateClientEvent_ArchiveDetails{
@@ -264,7 +226,7 @@ func (c *expArchiveRun) main() error {
MissCount: proto.Int64(int64(checker.Miss.Count)),
HitBytes: &checker.Hit.Bytes,
MissBytes: &checker.Miss.Bytes,
- IsolateHash: []string{string(isolItem.Digest)},
+ IsolateHash: []string{string(isolDigest)},
}
eventlogger := NewLogger(ctx, c.loggingFlags.EventlogEndpoint)
op := logpb.IsolateClientEvent_ARCHIVE.Enum()
« no previous file with comments | « no previous file | client/cmd/isolate/upload_tracker.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698