feat加入redis工具包
This commit is contained in:
@@ -43,6 +43,13 @@ database:
|
||||
name: omc_db
|
||||
backup: d:/local.git/ems.agt/restagent/database
|
||||
|
||||
# Redis 缓存数据
|
||||
redis:
|
||||
port: 6379
|
||||
host: "192.168.4.228"
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
mml:
|
||||
port: 4100
|
||||
sleep: 200
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"ems.agt/lib/core/redis"
|
||||
"ems.agt/lib/dborm"
|
||||
"ems.agt/lib/global"
|
||||
"ems.agt/lib/log"
|
||||
@@ -133,6 +134,7 @@ func main() {
|
||||
fmt.Printf("OMC restagent version: %s\n", global.Version)
|
||||
log.Infof("========================= OMC restagent startup =========================")
|
||||
log.Infof("OMC restagent version: %s %s %s", global.Version, global.BuildTime, global.GoVer)
|
||||
|
||||
err := dborm.InitDbClient(conf.Database.Type, conf.Database.User, conf.Database.Password,
|
||||
conf.Database.Host, conf.Database.Port, conf.Database.Name)
|
||||
if err != nil {
|
||||
@@ -164,6 +166,9 @@ func main() {
|
||||
os.Exit(4)
|
||||
}
|
||||
|
||||
// 连接redis
|
||||
redis.Connect()
|
||||
|
||||
router := routes.NewRouter()
|
||||
|
||||
// 开启监控采集
|
||||
|
||||
Reference in New Issue
Block a user