X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7b7de0ba345c02103bbaa9fb981424c59d440d55..f23f5689eac6354eb9567c91f2ff8586e2118e92:/lib/controller/handler.go diff --git a/lib/controller/handler.go b/lib/controller/handler.go index b51d909110..965ba040ed 100644 --- a/lib/controller/handler.go +++ b/lib/controller/handler.go @@ -32,9 +32,11 @@ import ( ) type Handler struct { - Cluster *arvados.Cluster + Cluster *arvados.Cluster + BackgroundContext context.Context setupOnce sync.Once + federation *federation.Conn handlerStack http.Handler proxy *proxy secureClient *http.Client @@ -103,7 +105,8 @@ func (h *Handler) setup() { healthFuncs := make(map[string]health.Func) oidcAuthorizer := localdb.OIDCAccessTokenAuthorizer(h.Cluster, h.db) - rtr := router.New(federation.New(h.Cluster, &healthFuncs), router.Config{ + h.federation = federation.New(h.Cluster, &healthFuncs) + rtr := router.New(h.federation, router.Config{ MaxRequestSize: h.Cluster.API.MaxRequestSize, WrapCalls: api.ComposeWrappers(ctrlctx.WrapCallsInTransactions(h.db), oidcAuthorizer.WrapCalls), }) @@ -152,6 +155,8 @@ func (h *Handler) setup() { h.proxy = &proxy{ Name: "arvados-controller", } + + go h.trashSweepWorker() } var errDBConnection = errors.New("database connection error")