func()

in internal/search/grpc.go [292:308]


func (searcher *Searcher) Close() error {
	searcher.grpcMutex.Lock()
	defer searcher.grpcMutex.Unlock()

	var errs []error
	for endpoint, conn := range searcher.GrpcConns {
		if err := conn.Close(); err != nil {
			errs = append(errs, fmt.Errorf("error closing gRPC connection to %s: %w", endpoint, err))
		}
	}

	searcher.GrpcConns = make(map[string]*grpc.ClientConn)
	if len(errs) > 0 {
		return errors.Join(errs...)
	}
	return nil
}