-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
37 lines (28 loc) · 676 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
package main
import (
"context"
"flag"
"github.com/sirupsen/logrus"
"go.opentelemetry.io/otel"
"go.uber.org/fx"
"github.com/afadian/fadian-telegram-bot/app"
)
var (
ctx = context.Background()
tracer = otel.Tracer("main")
application *fx.App
forceMigrate bool
)
func init() {
ctx, span := tracer.Start(ctx, "initialization")
defer span.End()
flag.BoolVar(&forceMigrate, "force-migrate", false, "force migrate database")
flag.Parse()
application = app.New(ctx, forceMigrate)
}
func main() {
ctx, span := tracer.Start(ctx, "application")
defer span.End()
logrus.WithContext(ctx).Info("Prepared to run application")
application.Run()
}