Skip to content

Commit

Permalink
changed prune logs from sprintf (#10669)
Browse files Browse the repository at this point in the history
Co-authored-by: Ilya Miheev <ilya.miheev@lamoda.ru>
  • Loading branch information
JkLondon and Ilya Miheev committed Jun 9, 2024
1 parent bfe6a02 commit 13e00cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions turbo/app/snapshots_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,20 +799,22 @@ func doRetireCommand(cliCtx *cli.Context) error {
return err
}
deletedBlocks := math.MaxInt // To pass the first iteration
for deletedBlocks > 0 { // prune happens by small steps, so need many runs
allDeletedBlocks := 0
for deletedBlocks > 0 { // prune happens by small steps, so need many runs
err = db.UpdateNosync(ctx, func(tx kv.RwTx) error {
if deletedBlocks, err = br.PruneAncientBlocks(tx, 100); err != nil {
return err
}

return nil
})
if err != nil {
return err
}

allDeletedBlocks += deletedBlocks
}

logger.Info(fmt.Sprintf("Pruning has ended. Deleted %d blocks", deletedBlocks))
logger.Info("Pruning has ended", "deleted blocks", allDeletedBlocks)

db, err = temporal.New(db, agg)
if err != nil {
Expand Down

0 comments on commit 13e00cb

Please sign in to comment.