Skip to content

Commit

Permalink
fix(nodebuilder/pruner): move pruner provide back to pruner pkg to av…
Browse files Browse the repository at this point in the history
…oid cyclical import
  • Loading branch information
renaynay committed Nov 1, 2024
1 parent 06179a2 commit fa7ba77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions nodebuilder/pruner/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/celestiaorg/celestia-node/nodebuilder/node"
"github.com/celestiaorg/celestia-node/pruner"
"github.com/celestiaorg/celestia-node/pruner/full"
"github.com/celestiaorg/celestia-node/pruner/light"
"github.com/celestiaorg/celestia-node/share/availability"
"github.com/celestiaorg/celestia-node/share/availability/light"
)

var log = logging.Logger("module/pruner")
Expand Down Expand Up @@ -45,7 +45,9 @@ func ConstructModule(tp node.Type, cfg *Config) fx.Option {
if cfg.EnableService {
return fx.Module("prune",
baseComponents,
prunerService,
// TODO(@walldiss @renaynay): remove conversion after Availability and Pruner interfaces are merged
// note this provide exists in pruner module to avoid cyclical imports
fx.Provide(func(la *light.ShareAvailability) pruner.Pruner { return la }),
)
}
// We do not trigger DetectPreviousRun for Light nodes, to allow them to disable pruning at wish.
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/share/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ func availabilityComponents(tp node.Type, cfg *Config) fx.Option {
},
fx.As(fx.Self()),
fx.As(new(share.Availability)),
fx.As(new(pruner.Pruner)), // TODO(@walldiss): remove conversion after Availability and Pruner interfaces are merged
fx.OnStop(func(ctx context.Context, la *light.ShareAvailability) error {
return la.Close(ctx)
}),
Expand Down

0 comments on commit fa7ba77

Please sign in to comment.