mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 13:19:53 +05:00
ApierV2.GetAccounts
This commit is contained in:
@@ -52,8 +52,14 @@ func (ms *MapStorage) Flush(ignore string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ms *MapStorage) GetKeysForPrefix(string) ([]string, error) {
|
||||
return nil, nil
|
||||
func (ms *MapStorage) GetKeysForPrefix(prefix string) ([]string, error) {
|
||||
keysForPrefix := make([]string, 0)
|
||||
for key := range ms.dict {
|
||||
if strings.HasPrefix(key, prefix) {
|
||||
keysForPrefix = append(keysForPrefix, key)
|
||||
}
|
||||
}
|
||||
return keysForPrefix, nil
|
||||
}
|
||||
|
||||
func (ms *MapStorage) CacheRating(dKeys, rpKeys, rpfKeys, alsKeys, lcrKeys []string) error {
|
||||
|
||||
@@ -959,17 +959,16 @@ func (self *SQLStorage) GetStoredCdrs(qryFltr *utils.CdrsFilter) ([]*utils.Store
|
||||
if qryFltr.PaginatorLimit != 0 {
|
||||
q = q.Limit(qryFltr.PaginatorLimit)
|
||||
}
|
||||
/* ToDo: Fix as soon as issue on Gorm analyzed: https://github.com/jinzhu/gorm/issues/354
|
||||
if qryFltr.Count {
|
||||
var cnt int64
|
||||
fmt.Printf("Rows is: %+v\n", rows)
|
||||
//fmt.Printf("Counting, got count: %+v\n", q.Count())
|
||||
if err := q.Count(&cnt).Error; err != nil {
|
||||
fmt.Printf("Counting, got error %s", err.Error())
|
||||
return nil, 0, err
|
||||
/*
|
||||
// ToDo: Fix as soon as issue on Gorm analyzed: https://github.com/jinzhu/gorm/issues/354
|
||||
if qryFltr.Count {
|
||||
var cnt int64
|
||||
//if err := q.Count(&cnt).Error; err != nil {
|
||||
if err := q.Debug().Count(&cnt).Error; err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
return nil, cnt, nil
|
||||
}
|
||||
return nil, cnt, nil
|
||||
}
|
||||
*/
|
||||
// Execute query
|
||||
rows, err := q.Rows()
|
||||
|
||||
Reference in New Issue
Block a user