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

Unified Diff: cipd/client/cipd/local/fs.go

Issue 2872193003: [cipd] delete bad cache files when failing do deploy them. (Closed)
Patch Set: fix things Created 3 years, 7 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 | « cipd/client/cipd/internal/instancecache_test.go ('k') | cipd/client/cipd/local/reader.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cipd/local/fs.go
diff --git a/cipd/client/cipd/local/fs.go b/cipd/client/cipd/local/fs.go
index e30595e4ba2c7e512c9a63df63604a3403c84b0c..99784cace9ba0f20bf0500a21eae6a034e8ab3b0 100644
--- a/cipd/client/cipd/local/fs.go
+++ b/cipd/client/cipd/local/fs.go
@@ -256,7 +256,9 @@ func (f *fsImpl) EnsureFileGone(ctx context.Context, path string) error {
}
if err = os.Remove(path); err != nil && !os.IsNotExist(err) {
logging.Warningf(ctx, "fs: failed to remove %s - %s", path, err)
- return err
+ if f.moveToTrash(ctx, path) == "" {
+ return err
+ }
}
return nil
}
« no previous file with comments | « cipd/client/cipd/internal/instancecache_test.go ('k') | cipd/client/cipd/local/reader.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698