Update blob pruning log (#13417)

This commit is contained in:
terence 2024-01-04 10:02:19 -08:00 committed by GitHub
parent d439e6da74
commit 3c1c0b3c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,8 +239,6 @@ func (p blobNamer) path() string {
func (bs *BlobStorage) Prune(pruneBefore primitives.Slot) error {
t := time.Now()
log.Debug("Pruning old blobs")
var dirs []string
err := afero.Walk(bs.fs, ".", func(path string, info os.FileInfo, err error) error {
if err != nil {
@ -266,12 +264,14 @@ func (bs *BlobStorage) Prune(pruneBefore primitives.Slot) error {
totalPruned += num
}
pruneTime := time.Since(t)
log.WithFields(log.Fields{
"lastPrunedEpoch": slots.ToEpoch(pruneBefore),
"pruneTime": pruneTime,
"numberBlobsPruned": totalPruned,
}).Debug("Pruned old blobs")
if totalPruned > 0 {
pruneTime := time.Since(t)
log.WithFields(log.Fields{
"lastPrunedEpoch": slots.ToEpoch(pruneBefore),
"pruneTime": pruneTime,
"numberBlobsPruned": totalPruned,
}).Debug("Pruned old blobs")
}
return nil
}