Skip to content

Commit

Permalink
Merge pull request #575 from bloxapp/stage
Browse files Browse the repository at this point in the history
Include cleaning exporter registry data (#574)
  • Loading branch information
olegshmuelov authored Apr 12, 2022
2 parents 74b9963 + e48a87b commit 1197d20
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions migrations/migration_5_clean_shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ package migrations

import (
"context"
"github.com/pkg/errors"
)

var migrationCleanValidatorRegistryData = Migration{
Name: "migration_5_clean_validator_registry_data",
Run: func(ctx context.Context, opt Options, key []byte) error {
nodeStorage := opt.nodeStorage()
err := nodeStorage.CleanRegistryData()
if err != nil {
return errors.Wrap(err, "could not clean node registry data")
}

validatorStorage := opt.validatorStorage()
err = validatorStorage.CleanRegistryData()
if err != nil {
return errors.Wrap(err, "could not clean validator registry data")
stores := opt.getRegistryStores()
for _, store := range stores {
err := store.CleanRegistryData()
if err != nil {
return err
}
}
return opt.Db.Set(migrationsPrefix, key, migrationCompleted)
},
Expand Down

0 comments on commit 1197d20

Please sign in to comment.