mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 16:37:24 +02:00
remove memberlist (#1615)
This commit is contained in:
parent
251dd8e03e
commit
ee03d0e9f8
6 changed files with 16 additions and 174 deletions
17
cache/cache.go
vendored
17
cache/cache.go
vendored
|
@ -10,9 +10,9 @@ import (
|
|||
"net"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/sync/errgroup"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"gopkg.in/tomb.v2"
|
||||
|
||||
"github.com/pomerium/pomerium/config"
|
||||
"github.com/pomerium/pomerium/internal/directory"
|
||||
|
@ -118,24 +118,19 @@ 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)
|
||||
if c.dataBrokerStorageType == config.StorageInMemoryName {
|
||||
t.Go(func() error {
|
||||
return c.runMemberList(ctx)
|
||||
})
|
||||
}
|
||||
t.Go(func() error {
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
eg.Go(func() error {
|
||||
return c.localGRPCServer.Serve(c.localListener)
|
||||
})
|
||||
t.Go(func() error {
|
||||
eg.Go(func() error {
|
||||
<-ctx.Done()
|
||||
c.localGRPCServer.Stop()
|
||||
return nil
|
||||
})
|
||||
t.Go(func() error {
|
||||
eg.Go(func() error {
|
||||
return c.manager.Run(ctx)
|
||||
})
|
||||
return t.Wait()
|
||||
return eg.Wait()
|
||||
}
|
||||
|
||||
func (c *Cache) update(cfg *config.Config) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue