Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tstorebe: Add record inventory fsck. #1520

Merged
merged 5 commits into from
Sep 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
review comments
  • Loading branch information
thi4go committed Sep 30, 2021
commit a32c3386519267ea5ee09293832f73d12b24c7dc
8 changes: 6 additions & 2 deletions politeiad/backendv2/tstorebe/tstorebe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,10 @@ func (t *tstoreBackend) Fsck() error {
}

// Sort records into vetted and unvetted groups.
vetted := make([]*backend.Record, 0, len(allTokens))
unvetted := make([]*backend.Record, 0, len(allTokens))
var (
vetted = make([]*backend.Record, 0, len(allTokens))
unvetted = make([]*backend.Record, 0, len(allTokens))
)
for _, token := range allTokens {
record := records[hex.EncodeToString(token)]
if record.RecordMetadata.State == backend.StateVetted {
Expand Down Expand Up @@ -1092,6 +1094,8 @@ func (t *tstoreBackend) Fsck() error {
record.RecordMetadata.Status)
}

log.Infof("%v records added to the inventory", len(allTokens))

// Update all plugin caches
return t.tstore.Fsck(allTokens)
}
Expand Down