-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathmain.go
More file actions
30 lines (24 loc) · 764 Bytes
/
main.go
File metadata and controls
30 lines (24 loc) · 764 Bytes
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
package main
import (
"time"
"github.com/OdyseeTeam/odysee-api/apps/lbrytv/config"
"github.com/OdyseeTeam/odysee-api/cmd"
"github.com/OdyseeTeam/odysee-api/internal/monitor"
"github.com/OdyseeTeam/odysee-api/internal/storage"
"github.com/OdyseeTeam/odysee-api/pkg/migrator"
"github.com/OdyseeTeam/odysee-api/version"
"github.com/getsentry/sentry-go"
)
func main() {
monitor.IsProduction = config.IsProduction()
monitor.ConfigureSentry(config.GetSentryDSN(), version.GetDevVersion(), monitor.LogMode())
defer sentry.Flush(2 * time.Second)
db, err := migrator.ConnectDB(migrator.DBConfigFromApp(config.GetDatabase()))
if err != nil {
panic(err)
}
defer db.Close()
storage.SetDB(db)
go storage.WatchMetrics(10 * time.Second)
cmd.Execute()
}