-
Notifications
You must be signed in to change notification settings - Fork 15
/
app.go
33 lines (25 loc) · 920 Bytes
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package app
import (
"github.com/intelops/go-common/logging"
workerframework "github.com/kube-tarian/kad/capten/common-pkg/worker-framework"
"github.com/kube-tarian/kad/capten/config-worker/internal/activities"
"github.com/kube-tarian/kad/capten/config-worker/internal/workflows"
)
const (
WorkflowTaskQueueName = "Configure"
)
func Start() {
logger := logging.NewLogger()
logger.Infof("Starting config worker..\n")
worker, err := workerframework.NewWorkerV2(WorkflowTaskQueueName, logger)
if err != nil {
logger.Fatalf("Worker initialization failed, Reason: %v", err)
}
worker.RegisterWorkflows([]interface{}{workflows.Workflow}...)
worker.RegisterActivities([]interface{}{&activities.Activities{}}...)
logger.Infof("Running config worker..\n")
if err := worker.Run(); err != nil {
logger.Fatalf("failed to start the config-worker, err: %v", err)
}
logger.Infof("Exiting config worker\n")
}