OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package backend | 5 package backend |
6 | 6 |
7 import ( | 7 import ( |
8 "errors" | 8 "errors" |
9 "fmt" | 9 "fmt" |
10 "net/http" | 10 "net/http" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 log.Fields{ | 45 log.Fields{ |
46 log.ErrorKey: err, | 46 log.ErrorKey: err, |
47 "path": path, | 47 "path": path, |
48 }.Errorf(c, "Invalid stream path.") | 48 }.Errorf(c, "Invalid stream path.") |
49 return nil | 49 return nil |
50 } | 50 } |
51 log.Fields{ | 51 log.Fields{ |
52 "path": path, | 52 "path": path, |
53 }.Infof(c, "Received storage cleanup request.") | 53 }.Infof(c, "Received storage cleanup request.") |
54 | 54 |
55 » st, err := b.s.Storage(c) | 55 » st, err := b.s.IntermediateStorage(c) |
56 if err != nil { | 56 if err != nil { |
57 log.WithError(err).Errorf(c, "Failed to get Storage instance.") | 57 log.WithError(err).Errorf(c, "Failed to get Storage instance.") |
58 return errStorageCleanupFailed | 58 return errStorageCleanupFailed |
59 } | 59 } |
60 defer st.Close() | 60 defer st.Close() |
61 | 61 |
62 if err := st.Purge(path); err != nil { | 62 if err := st.Purge(path); err != nil { |
63 log.WithError(err).Errorf(c, "Failed to purge log stream path.") | 63 log.WithError(err).Errorf(c, "Failed to purge log stream path.") |
64 return errStorageCleanupFailed | 64 return errStorageCleanupFailed |
65 } | 65 } |
(...skipping 18 matching lines...) Expand all Loading... |
84 return err | 84 return err |
85 } | 85 } |
86 return nil | 86 return nil |
87 }, nil) | 87 }, nil) |
88 if err != nil { | 88 if err != nil { |
89 log.WithError(err).Errorf(c, "Failed to mark log stream as clean
ed up.") | 89 log.WithError(err).Errorf(c, "Failed to mark log stream as clean
ed up.") |
90 return err | 90 return err |
91 } | 91 } |
92 return nil | 92 return nil |
93 } | 93 } |
OLD | NEW |