17944: Adds /_health/vocabulary health endpoint. Improves cache refreshing.
[arvados.git] / lib / controller / federation / conn.go
index d477303527c7b71e827607a24af1ba838ee23464..7efbda8d127d523927f66a30ef6c5b4923811368 100644 (file)
@@ -22,6 +22,7 @@ import (
        "git.arvados.org/arvados.git/sdk/go/arvados"
        "git.arvados.org/arvados.git/sdk/go/auth"
        "git.arvados.org/arvados.git/sdk/go/ctxlog"
+       "git.arvados.org/arvados.git/sdk/go/health"
 )
 
 type Conn struct {
@@ -30,7 +31,7 @@ type Conn struct {
        remotes map[string]backend
 }
 
-func New(cluster *arvados.Cluster) *Conn {
+func New(cluster *arvados.Cluster, vocHealthFunc *health.Func) *Conn {
        local := localdb.NewConn(cluster)
        remotes := map[string]backend{}
        for id, remote := range cluster.RemoteClusters {
@@ -44,6 +45,8 @@ func New(cluster *arvados.Cluster) *Conn {
                remotes[id] = conn
        }
 
+       *vocHealthFunc = local.LastVocabularyError
+
        return &Conn{
                cluster: cluster,
                local:   local,