Skip to content

Commit

Permalink
Use inline factoryParams in ringpop factory
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden committed Jun 27, 2023
1 parent 1e18621 commit 81abb35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
18 changes: 2 additions & 16 deletions common/membership/ringpop/factory.go
Expand Up @@ -69,14 +69,7 @@ type factoryParams struct {

// factory provides ringpop based membership objects
type factory struct {
Config *config.Membership
ServiceName primitives.ServiceName
ServicePortMap config.ServicePortMap
Logger log.Logger
MetadataManager persistence.ClusterMetadataManager
RPCConfig *config.RPC
TLSFactory encryption.TLSConfigProvider
DC *dynamicconfig.Collection
*factoryParams

channel *tchannel.Channel
monitor *monitor
Expand All @@ -98,14 +91,7 @@ func newFactory(params factoryParams) (*factory, error) {
}

return &factory{
Config: params.Config,
ServiceName: params.ServiceName,
ServicePortMap: params.ServicePortMap,
Logger: params.Logger,
MetadataManager: params.MetadataManager,
RPCConfig: params.RPCConfig,
TLSFactory: params.TLSFactory,
DC: params.DC,
factoryParams: &params,
}, nil
}

Expand Down
11 changes: 6 additions & 5 deletions common/membership/ringpop/factory_test.go
Expand Up @@ -179,11 +179,12 @@ func newTestRingpopFactory(
dc *dynamicconfig.Collection,
) *factory {
return &factory{
ServiceName: serviceName,
Logger: logger,
RPCConfig: rpcConfig,
TLSFactory: tlsProvider,
DC: dc,
factoryParams: &factoryParams{ServiceName: serviceName,
Logger: logger,
RPCConfig: rpcConfig,
TLSFactory: tlsProvider,
DC: dc,
},
}
}

Expand Down

0 comments on commit 81abb35

Please sign in to comment.