| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package main
- import (
- "bet24.com/log"
- "bet24.com/redis"
- "bet24.com/servers/monitor"
- "bet24.com/servers/payment/config"
- _ "bet24.com/servers/payment/crons"
- "bet24.com/servers/payment/db"
- "bet24.com/servers/payment/liu"
- "bet24.com/servers/payment/router"
- "bet24.com/utils"
- "fmt"
- "time"
- coreservice "bet24.com/servers/coreservice/client"
- )
- func main() {
- //defer log.PanicHandler("payment")
- config.Run()
- redis.InitPool(config.Server.ChannelUrl, config.Server.ChannelPassword, config.Server.RedisDB)
- coreservice.SetServiceAddr(config.Server.ServiceAddr)
- db.Run()
- // liu.Run()
- go waitInput()
- //监控
- monitor.Run(config.Server.MonitorPort, config.Server.LogPath)
- //定时器
- //go crons.Run()
- log.Release("Server started %v", time.Now())
- utils.SetConsoleTitle(fmt.Sprintf("payment port:%d monitor:%d", config.Server.TlsPort, config.Server.MonitorPort))
- //gin 路由
- router.Run()
- }
- func waitInput() {
- for {
- var cmd string
- var param1 string
- var param2 string
- fmt.Scanf("%s %s %s", &cmd, ¶m1, ¶m2)
- switch cmd {
- case "":
- case "queue":
- liu.Dump(param1, param2)
- case "exit":
- return
- default:
- log.Release("unknown command1")
- }
- }
- }
|