mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-23 14:07:11 +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
|
localListener net.Listener
|
||||||
localGRPCServer *grpc.Server
|
localGRPCServer *grpc.Server
|
||||||
localGRPCConnection *grpc.ClientConn
|
localGRPCConnection *grpc.ClientConn
|
||||||
|
dataBrokerStorageType string //TODO remove in v0.11
|
||||||
deprecatedCacheClusterDomain 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,
|
localGRPCServer: localGRPCServer,
|
||||||
localGRPCConnection: localGRPCConnection,
|
localGRPCConnection: localGRPCConnection,
|
||||||
deprecatedCacheClusterDomain: opts.GetDataBrokerURL().Hostname(),
|
deprecatedCacheClusterDomain: opts.GetDataBrokerURL().Hostname(),
|
||||||
|
dataBrokerStorageType: opts.DataBrokerStorageType,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,9 +102,11 @@ func (c *Cache) Register(grpcServer *grpc.Server) {
|
||||||
// Run runs the cache components.
|
// Run runs the cache components.
|
||||||
func (c *Cache) Run(ctx context.Context) error {
|
func (c *Cache) Run(ctx context.Context) error {
|
||||||
t, ctx := tomb.WithContext(ctx)
|
t, ctx := tomb.WithContext(ctx)
|
||||||
t.Go(func() error {
|
if c.dataBrokerStorageType == config.StorageInMemoryName {
|
||||||
return c.runMemberList(ctx)
|
t.Go(func() error {
|
||||||
})
|
return c.runMemberList(ctx)
|
||||||
|
})
|
||||||
|
}
|
||||||
t.Go(func() error {
|
t.Go(func() error {
|
||||||
return c.localGRPCServer.Serve(c.localListener)
|
return c.localGRPCServer.Serve(c.localListener)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue