Skip to content

Commit

Permalink
ProviderManyWrapper to ProviderMany
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnavarro committed Jul 7, 2022
1 parent 45a716e commit fd9bfc9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/node/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func SimpleProviderSys(isOnline bool) interface{} {
// BatchedProviderSys creates new provider system
func BatchedProviderSys(isOnline bool, reprovideInterval string) interface{} {
return func(lc fx.Lifecycle, cr irouting.TieredRouter, q *q.Queue, keyProvider simple.KeyChanFunc, repo repo.Repo) (provider.System, error) {
r := cr.ProviderManyWrapper()
r := cr.ProviderMany()
if r == nil {
return nil, fmt.Errorf("BatchedProviderSys requires a content router that supports provideMany")
}
Expand Down
6 changes: 3 additions & 3 deletions routing/delegated.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

type TieredRouter interface {
routing.Routing
ProviderManyWrapper() ProvideMany
ProviderMany() ProvideMany
}

var _ TieredRouter = &Tiered{}
Expand All @@ -23,9 +23,9 @@ type Tiered struct {
routinghelpers.Tiered
}

// ProviderManyWrapper returns a ProviderMany implementation including all Routers that
// ProviderMany returns a ProviderMany implementation including all Routers that
// implements ProviderMany
func (ds Tiered) ProviderManyWrapper() ProvideMany {
func (ds Tiered) ProviderMany() ProvideMany {
var pms []ProvideMany
for _, r := range ds.Tiered.Routers {
pm, ok := r.(ProvideMany)
Expand Down
4 changes: 2 additions & 2 deletions routing/delegated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ func TestTieredRouter(t *testing.T) {
},
}

pm := tr.ProviderManyWrapper()
pm := tr.ProviderMany()
require.Nil(pm)

tr.Tiered.Routers = append(tr.Tiered.Routers, &dummyRouter{})

pm = tr.ProviderManyWrapper()
pm = tr.ProviderMany()
require.NotNil(pm)
}

Expand Down

0 comments on commit fd9bfc9

Please sign in to comment.