diff --git a/src/handler/counthandler.go b/src/handler/counthandler.go index b51d1d8c84b51c2bca0e6e153848f2c28a8ad0ed..19a0904362addaadaf9ffd4231382384e7d88ae8 100644 --- a/src/handler/counthandler.go +++ b/src/handler/counthandler.go @@ -13,6 +13,13 @@ func GetCount(c *gin.Context) { c.Error(err) } ic, err := redis.Get("bgproxy" + config.ProxyConf.MeshId) + if err != nil { + c.JSON(500, gin.H{ + "success": 0, + "errMsg": err, + }) + return + } c.JSON(200, gin.H{ "Key": fmt.Sprintf("bgproxy" + config.ProxyConf.MeshId), "Count": ic, diff --git a/src/handler/proxyhandler.go b/src/handler/proxyhandler.go index f5ed5a677b7436e0d4fc11f00818e994d08f6210..2681afae6768459e5375904186cf3e3e9adbec4d 100644 --- a/src/handler/proxyhandler.go +++ b/src/handler/proxyhandler.go @@ -77,7 +77,7 @@ func count() error { if err != nil { return err } - ic, err := redis.Incr("bgproxy-" + config.ProxyConf.MeshId) + ic, err := redis.Incr("bgproxy" + config.ProxyConf.MeshId) _, err = ic.Result() return err }