Browse Source

Merge branch 'master' of http://gogs.sdgaoxintong.com:8989/gaoxintong/sparrow

yuxiujuan 4 years ago
parent
commit
9ea41aaa29
2 changed files with 4 additions and 1 deletions
  1. 2 0
      pkg/cache/memcache.go
  2. 2 1
      services/registry/registry.go

+ 2 - 0
pkg/cache/memcache.go

@@ -30,6 +30,8 @@ func NewMemCache(maxItemSize int) *MemCache {
 		maxItemSize: maxItemSize,
 		cacheList:   list.New(),
 		cache:       make(map[interface{}]*list.Element),
+		hits:        0,
+		gets:        0,
 	}
 }
 

+ 2 - 1
services/registry/registry.go

@@ -187,7 +187,7 @@ func (r *Registry) ValidateApplication(key string, reply *models.Application) er
 	}
 
 	if reply.AppKey != key {
-		return errors.New("app key not match.")
+		return errors.New("app key not match")
 	}
 
 	return nil
@@ -482,6 +482,7 @@ func (r *Registry) QueryRules(args *models.Rule, reply *[]models.Rule) error {
 
 	return nil
 }
+
 // CreateEvent create event
 func (r *Registry) CreateEvent(args *models.Event, reply *rpcs.ReplyEmptyResult) error {
 	db, err := getDB()