-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (30 loc) · 743 Bytes
/
main.go
File metadata and controls
38 lines (30 loc) · 743 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
31
32
33
34
35
36
37
38
package main
import (
"github.com/astaxie/beego"
_ "bitsync/models"
"github.com/astaxie/beego/logs"
_ "bitsync/util"
_ "bitsync/routers"
"bitsync/controllers"
"bitsync/task/server"
"bitsync/task"
)
func init() {
runMode := beego.AppConfig.String("runmode")
if runMode == "prod" {
beego.SetLevel(beego.LevelInformational)
}
beego.SetLogFuncCall(true)
beego.SetLogger(logs.AdapterFile, `{"filename":"log/bitsync.log","daily":true,"maxdays":7}`)
// 任务调度
t := task.BaseTask{}
t.Execute()
}
func main() {
beego.ErrorController(&controllers.ErrorController{})
// 启动行情服务器
beego.Info("启动行情服务器...")
go server.MarketServer()
beego.Info("初始化完成,启动应用...")
beego.Run()
}