mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
layer: layerstore.Cleanup(): improve some logging
Improve consistency for the logs, and remove a redundant log: time="2022-06-07T15:37:24.418470152Z" level=debug msg="found 0 orphan layers" Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c2e32c144c
commit
068ab51442
1 changed files with 5 additions and 3 deletions
|
@ -739,11 +739,13 @@ func (ls *layerStore) assembleTarTo(graphID string, metadata io.ReadCloser, size
|
|||
func (ls *layerStore) Cleanup() error {
|
||||
orphanLayers, err := ls.store.getOrphan()
|
||||
if err != nil {
|
||||
logrus.Errorf("Cannot get orphan layers: %v", err)
|
||||
logrus.WithError(err).Error("cannot get orphan layers")
|
||||
}
|
||||
if len(orphanLayers) > 0 {
|
||||
logrus.Debugf("found %v orphan layers", len(orphanLayers))
|
||||
}
|
||||
logrus.Debugf("found %v orphan layers", len(orphanLayers))
|
||||
for _, orphan := range orphanLayers {
|
||||
logrus.Debugf("removing orphan layer, chain ID: %v , cache ID: %v", orphan.chainID, orphan.cacheID)
|
||||
logrus.WithField("cache-id", orphan.cacheID).Debugf("removing orphan layer, chain ID: %v", orphan.chainID)
|
||||
err = ls.driver.Remove(orphan.cacheID)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
logrus.WithError(err).WithField("cache-id", orphan.cacheID).Error("cannot remove orphan layer")
|
||||
|
|
Loading…
Add table
Reference in a new issue