ApierV2.GetAccounts

This commit is contained in:
DanB
2015-02-06 13:24:51 +01:00
parent 8576d8f6fc
commit ff68023ca5
5 changed files with 185 additions and 13 deletions

View File

@@ -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 {

View File

@@ -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()