mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fix nrItems in storage CacheDataFromDB
This commit is contained in:
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user