mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-23 05:57:19 +02:00
cache: only run memberlist for in-memory databroker (#1224)
This commit is contained in:
parent
4976fe3824
commit
8e48ae03a8
1 changed files with 7 additions and 3 deletions
10
cache/cache.go
vendored
10
cache/cache.go
vendored
|
@ -30,6 +30,7 @@ type Cache struct {
|
|||
localListener net.Listener
|
||||
localGRPCServer *grpc.Server
|
||||
localGRPCConnection *grpc.ClientConn
|
||||
dataBrokerStorageType string //TODO remove in v0.11
|
||||
deprecatedCacheClusterDomain string //TODO: remove in v0.11
|
||||
}
|
||||
|
||||
|
@ -89,6 +90,7 @@ func New(opts config.Options) (*Cache, error) {
|
|||
localGRPCServer: localGRPCServer,
|
||||
localGRPCConnection: localGRPCConnection,
|
||||
deprecatedCacheClusterDomain: opts.GetDataBrokerURL().Hostname(),
|
||||
dataBrokerStorageType: opts.DataBrokerStorageType,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -100,9 +102,11 @@ func (c *Cache) Register(grpcServer *grpc.Server) {
|
|||
// Run runs the cache components.
|
||||
func (c *Cache) Run(ctx context.Context) error {
|
||||
t, ctx := tomb.WithContext(ctx)
|
||||
t.Go(func() error {
|
||||
return c.runMemberList(ctx)
|
||||
})
|
||||
if c.dataBrokerStorageType == config.StorageInMemoryName {
|
||||
t.Go(func() error {
|
||||
return c.runMemberList(ctx)
|
||||
})
|
||||
}
|
||||
t.Go(func() error {
|
||||
return c.localGRPCServer.Serve(c.localListener)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue