Move pruning log to after retention check (#13348)

This commit is contained in:
terence 2023-12-15 08:49:29 +08:00 committed by GitHub
parent ddcf0c18dc
commit 53bc96844e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,8 +232,6 @@ func (p blobNamer) path() string {
// It deletes blobs older than currentEpoch - (retentionEpochs+bufferEpochs).
// This is so that we keep a slight buffer and blobs are deleted after n+2 epochs.
func (bs *BlobStorage) Prune(currentSlot primitives.Slot) error {
log.Debug("Pruning old blobs")
t := time.Now()
retentionSlots, err := slots.EpochStart(bs.retentionEpochs + bufferEpochs)
if err != nil {
@ -243,6 +241,8 @@ func (bs *BlobStorage) Prune(currentSlot primitives.Slot) error {
return nil // Overflow would occur
}
log.Debug("Pruning old blobs")
folders, err := afero.ReadDir(bs.fs, ".")
if err != nil {
return err