hook the upgrade schedule to splitstore start
This commit is contained in:
parent
f7067adf70
commit
e54c8dac56
@ -78,6 +78,7 @@ func ChainStore(lc fx.Lifecycle,
|
|||||||
ds dtypes.MetadataDS,
|
ds dtypes.MetadataDS,
|
||||||
basebs dtypes.BaseBlockstore,
|
basebs dtypes.BaseBlockstore,
|
||||||
weight store.WeightFunc,
|
weight store.WeightFunc,
|
||||||
|
us stmgr.UpgradeSchedule,
|
||||||
j journal.Journal) *store.ChainStore {
|
j journal.Journal) *store.ChainStore {
|
||||||
|
|
||||||
chain := store.NewChainStore(cbs, sbs, ds, weight, j)
|
chain := store.NewChainStore(cbs, sbs, ds, weight, j)
|
||||||
@ -89,7 +90,7 @@ func ChainStore(lc fx.Lifecycle,
|
|||||||
var startHook func(context.Context) error
|
var startHook func(context.Context) error
|
||||||
if ss, ok := basebs.(*splitstore.SplitStore); ok {
|
if ss, ok := basebs.(*splitstore.SplitStore); ok {
|
||||||
startHook = func(_ context.Context) error {
|
startHook = func(_ context.Context) error {
|
||||||
err := ss.Start(chain)
|
err := ss.Start(chain, us)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = xerrors.Errorf("error starting splitstore: %w", err)
|
err = xerrors.Errorf("error starting splitstore: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user