Don't fail compactdb on corruption but log warning

pull/3/head
Oliver Gugger 4 years ago
parent d323c0f42b
commit 937db7b4aa
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -165,6 +165,13 @@ func (c *compactDBCommand) walkBucket(b *bbolt.Bucket, keypath [][]byte,
return b.ForEach(func(k, v []byte) error {
if v == nil {
bkt := b.Bucket(k)
if bkt == nil {
log.Warnf("Could not read bucket '%s' (full " +
"path '%s') database is likely " +
"corrupted. Continuing anyway but " +
"skipping corrupt bucket.", k, keypath)
return nil
}
return c.walkBucket(
bkt, keypath, k, nil, bkt.Sequence(), fn,
)

Loading…
Cancel
Save