-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
35 lines (28 loc) · 904 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
package main
import (
"github.com/cryingmouse/data_management_engine/common"
"github.com/cryingmouse/data_management_engine/db"
"github.com/cryingmouse/data_management_engine/webservice"
)
func init() {
// Initialize the configuration first and then Loggers.
if err := common.InitializeConfig("config.ini"); err != nil {
panic(err)
}
common.SetupLoggers()
common.Logger.Debug("Initialize logger successfully.")
}
func main() {
engine, err := db.GetDatabaseEngine()
if err != nil {
common.Logger.Error("Failed to initialize database. Error: %w", err)
panic(err)
}
common.Logger.Debug("Initialize database successfully.")
if err := engine.Migrate(); err != nil {
common.Logger.Error("Failed to migration database. Error: %w", err)
}
// scheduler.StartScheduler()
webservice.Start()
common.Logger.Debug("Start web service successfully.")
}