提交 04d93eff 编写于 作者: U Ulric Qin

refactor observe functions

上级 40d60aeb
......@@ -60,7 +60,7 @@ func Initialize(configDir string, cryptoKey string) (func(), error) {
r := httpx.GinEngine(config.Global.RunMode, config.HTTP)
rt := router.New(config.HTTP, config.Alert, alertMuteCache, targetCache, busiGroupCache, alertStats, ctx, externalProcessors)
rt.Config(r)
obs.ConfigSyncRouter(r)
obs.ConfigRouter(r)
httpClean := httpx.Init(config.HTTP, r)
......
......@@ -93,7 +93,7 @@ func Initialize(configDir string, cryptoKey string) (func(), error) {
centerRouter.Config(r)
alertrtRouter.Config(r)
pushgwRouter.Config(r)
obs.ConfigSyncRouter(r)
obs.ConfigRouter(r)
httpClean := httpx.Init(config.HTTP, r)
......
......@@ -63,7 +63,7 @@ func Initialize(configDir string, cryptoKey string) (func(), error) {
alertrtRouter.Config(r)
}
obs.ConfigSyncRouter(r)
obs.ConfigRouter(r)
httpClean := httpx.Init(config.HTTP, r)
return func() {
......
package obs
import "github.com/gin-gonic/gin"
// package level functions
func ConfigRouter(r *gin.Engine) {
syncObs.ConfigRouter(r)
}
......@@ -105,11 +105,6 @@ func (so *SyncObs) ConfigRouter(r *gin.Engine) {
})
}
// package level functions
func ConfigSyncRouter(r *gin.Engine) {
syncObs.ConfigRouter(r)
}
func PutSyncRecord(key string, timestamp, mills int64, count int, message string) {
syncObs.Put(key, timestamp, mills, count, message)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册