From c860b90adfc29ba12b092e3f18f6014ab12a3e3c Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Fri, 7 Jul 2023 17:21:03 +0800 Subject: [PATCH] fix: fix discontinue panic issue (#330) --- x/storage/abci.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/storage/abci.go b/x/storage/abci.go index 321a25fcb..24602c8fb 100644 --- a/x/storage/abci.go +++ b/x/storage/abci.go @@ -28,7 +28,8 @@ func EndBlocker(ctx sdk.Context, keeper k.Keeper) { // delete objects deleted, err := keeper.DeleteDiscontinueObjectsUntil(ctx, blockTime, deletionMax) if err != nil { - panic("fail to delete objects, err " + err.Error()) + ctx.Logger().Error("fail to delete objects", "err", err.Error()) + //panic("fail to delete objects, err " + err.Error()) } if deleted >= deletionMax { @@ -38,7 +39,8 @@ func EndBlocker(ctx sdk.Context, keeper k.Keeper) { // delete buckets _, err = keeper.DeleteDiscontinueBucketsUntil(ctx, blockTime, deletionMax-deleted) if err != nil { - panic("fail to delete buckets, err " + err.Error()) + ctx.Logger().Error("fail to delete buckets", "err", err.Error()) + //panic("fail to delete buckets, err " + err.Error()) } keeper.PersistDeleteInfo(ctx)