mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 15:18:44 +05:00
fix limit on load history
This commit is contained in:
@@ -1274,7 +1274,10 @@ func (ms *MongoStorage) GetLoadHistory(limit int, skipCache bool) (loadInsts []*
|
||||
CacheRemKey(utils.LOADINST_KEY)
|
||||
CacheSet(utils.LOADINST_KEY, loadInsts)
|
||||
}
|
||||
return loadInsts, nil
|
||||
if len(loadInsts) < limit || limit == -1 {
|
||||
return loadInsts, nil
|
||||
}
|
||||
return loadInsts[:limit], nil
|
||||
}
|
||||
|
||||
// Adds a single load instance to load history
|
||||
|
||||
@@ -934,7 +934,10 @@ func (rs *RedisStorage) GetLoadHistory(limit int, skipCache bool) ([]*utils.Load
|
||||
}
|
||||
CacheRemKey(utils.LOADINST_KEY)
|
||||
CacheSet(utils.LOADINST_KEY, loadInsts)
|
||||
return loadInsts, nil
|
||||
if len(loadInsts) < limit || limit == -1 {
|
||||
return loadInsts, nil
|
||||
}
|
||||
return loadInsts[:limit], nil
|
||||
}
|
||||
|
||||
// Adds a single load instance to load history
|
||||
|
||||
Reference in New Issue
Block a user