Fix nrItems in storage CacheDataFromDB

This commit is contained in:
DanB
2017-09-03 20:30:06 +02:00
parent ca059c4faa
commit b4431d7fda
2 changed files with 2 additions and 2 deletions

View File

@@ -493,7 +493,7 @@ func (ms *MongoStorage) CacheDataFromDB(prfx string, ids []string, mustBeCached
if cCfg, has := ms.cacheCfg[utils.CachePrefixToInstance[prfx]]; has {
nrItems = cCfg.Limit
}
if nrItems != 0 && nrItems < len(ids) { // More ids than cache config allows it, limit here
if nrItems > 0 && nrItems < len(ids) { // More ids than cache config allows it, limit here
ids = ids[:nrItems]
}
}

View File

@@ -257,7 +257,7 @@ func (rs *RedisStorage) CacheDataFromDB(prfx string, ids []string, mustBeCached
if cCfg, has := rs.cacheCfg[utils.CachePrefixToInstance[prfx]]; has {
nrItems = cCfg.Limit
}
if nrItems != 0 && nrItems < len(ids) {
if nrItems > 0 && nrItems < len(ids) {
ids = ids[:nrItems]
}
}