-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
43 lines (34 loc) · 892 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
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/jstang9527/gateway/thirdpart/es"
"github.com/jstang9527/gateway/thirdpart/selm"
"github.com/jstang9527/gateway/router"
"github.com/e421083458/golang_common/lib"
)
func main() {
lib.InitModule("./conf/dev/", []string{"base", "mysql", "redis"})
defer lib.Destroy()
// 启动任务调度器
// core.Run()
// 启动selenium后台服务
if err := selm.Init(); err != nil {
fmt.Println("Failed Init Selenium Service, Info: ", err)
return
}
// 创建ES连接池、启动推送守护进程
if err := es.InitES(); err != nil {
fmt.Println("Failed Init Elasticsearch Service, Info: ", err)
return
}
router.HTTPServerRun()
quit := make(chan os.Signal)
signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM)
<-quit
selm.Stop()
es.Stop()
router.HTTPServerStop()
}