Skip to content

Commit

Permalink
change:
Browse files Browse the repository at this point in the history
none
bugfix:
fix product's vendor id is wrong in cache.
  • Loading branch information
ruizeng committed Aug 28, 2016
1 parent 10abdf1 commit e2c44ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions services/registry/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

const (
flagCacheSize = "cacheSize"
flagCacheSize = "cacheSize"
defaultCacheSize = 102400
)

Expand All @@ -16,8 +16,8 @@ var (

var MemCache cache.Cache

func getCache() (cache.Cache) {
if MemCache == nil{
func getCache() cache.Cache {
if MemCache == nil {
MemCache = cache.NewMemCache(*confCacheSize)
}
return MemCache
Expand Down
1 change: 1 addition & 0 deletions services/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func setProduct(target *models.Product, src *models.Product) {
target.ProductDescription = src.ProductDescription
target.ProductKey = src.ProductKey
target.ProductConfig = src.ProductConfig
target.VendorID = src.VendorID
target.CreatedAt = src.CreatedAt
target.UpdatedAt = src.UpdatedAt
}
Expand Down
2 changes: 1 addition & 1 deletion services/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func testDevice(t *testing.T, r *Registry) {
if err != nil {
t.Error(err)
}

devRow := &models.Device{}
err = r.FindDeviceByIdentifier(device.DeviceIdentifier, devRow)
if err != nil {
Expand Down

0 comments on commit e2c44ad

Please sign in to comment.