forked from cadence-workflow/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (36 loc) · 992 Bytes
/
main.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
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"code.uber.internal/devexp/minions/config"
"code.uber.internal/devexp/minions/service"
"code.uber.internal/go-common.git/x/jaeger"
"code.uber.internal/go-common.git/x/log"
)
func main() {
// Load configuration
appConfig, err := config.LoadConfig()
if err != nil {
log.Fatalf("Error initializing workflow configuration: %s", err)
return
}
metrics, err := appConfig.Metrics.New()
if err != nil {
log.Fatalf("Could not connect to metrics: %v", err)
}
metrics.Counter("boot").Inc(1)
// Launch Jaeger tracing.
closer, err := xjaeger.InitGlobalTracer(appConfig.Jaeger, appConfig.ServiceName, metrics)
if err != nil {
log.Fatalf("Jaeger.InitGlobalTracer failed: %v", err)
}
defer closer.Close()
// Start TChannel workflow server
server := service.NewTChannelWorkflowServer()
err = server.Start(appConfig)
if err != nil {
log.Fatalf("Error initializing workflow configuration: %s", err)
return
}
// ...
// Block forever.
select {}
}