diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index c57cbe6f..1a829023 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -235,6 +235,13 @@ func (s *Server) Stop() { } } +func (s *Server) registerNoErrCloser(c func()) { + s.registerCloser(func() error { + c() + return nil + }) +} + func (s *Server) registerIOCloser(c io.Closer) { s.registerCloser(c.Close) } @@ -393,6 +400,8 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error RangeTimeout: cfg.GetDuration("audit.timeout.rangehash"), }) + server.registerNoErrCloser(clientCache.cache.CloseAll) + pdpPoolSize := cfg.GetInt("audit.pdp.pairs_pool_size") porPoolSize := cfg.GetInt("audit.por.pool_size") diff --git a/pkg/innerring/rpc.go b/pkg/innerring/rpc.go index 45130612..3d812d2d 100644 --- a/pkg/innerring/rpc.go +++ b/pkg/innerring/rpc.go @@ -23,6 +23,7 @@ type ( log *zap.Logger cache interface { Get(address *network.Address) (client.Client, error) + CloseAll() } key *ecdsa.PrivateKey