File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ func New(cfg *api.Config) (api.NodeDB, error) {
108108 // but not yet compacted. Then the NodeDB is restarted, only this time with pruning disabled.
109109 // Unless setting discard timestamp to the earliest version manually, the data stored for the
110110 // already pruned versions may never be compacted, resulting in redundant disk usage.
111- if earliest := db .GetEarliestVersion (); earliest > tsMetadata {
112- db .db .SetDiscardTs (earliest - 1 )
111+ if discardTs := versionToTs ( db .GetEarliestVersion ()) - 1 ; discardTs > tsMetadata {
112+ db .db .SetDiscardTs (discardTs )
113113 }
114114
115115 return db , nil
Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ func New(cfg *api.Config) (api.NodeDB, error) {
6565 // but not yet compacted. Then the NodeDB is restarted, only this time with pruning disabled.
6666 // Unless setting discard timestamp to the earliest version manually, the data stored for the
6767 // already pruned versions may never be compacted, resulting in redundant disk usage.
68- if earliest := db .GetEarliestVersion (); earliest > tsMetadata {
69- db .db .SetDiscardTs (earliest - 1 )
68+ if discardTs := versionToTs ( db .GetEarliestVersion ()) - 1 ; discardTs > tsMetadata {
69+ db .db .SetDiscardTs (discardTs )
7070 }
7171
7272 return db , nil
You can’t perform that action at this time.
0 commit comments