14807: Use context to pass a suitable logger to all service commands.
[arvados.git] / lib / dispatchcloud / cmd.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package dispatchcloud
6
7 import (
8         "context"
9
10         "git.curoverse.com/arvados.git/lib/cmd"
11         "git.curoverse.com/arvados.git/lib/service"
12         "git.curoverse.com/arvados.git/sdk/go/arvados"
13 )
14
15 var Command cmd.Handler = service.Command(arvados.ServiceNameDispatchCloud, newHandler)
16
17 func newHandler(ctx context.Context, cluster *arvados.Cluster, _ *arvados.NodeProfile) service.Handler {
18         d := &dispatcher{Cluster: cluster, Context: ctx}
19         go d.Start()
20         return d
21 }