mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
Sync GetKeysForPrefix for InternalDB with other DataDBs
This commit is contained in:
committed by
Dan Christian Bogos
parent
65113f2739
commit
769edb94ff
@@ -81,17 +81,13 @@ func (iDB *InternalDB) SelectDatabase(dbName string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (iDB *InternalDB) GetKeysForPrefix(prefix string) (ids []string, err error) {
|
||||
func (iDB *InternalDB) GetKeysForPrefix(prefix string) ([]string, error) {
|
||||
keyLen := len(utils.DESTINATION_PREFIX)
|
||||
if len(prefix) < keyLen {
|
||||
return nil, fmt.Errorf("unsupported prefix in GetKeysForPrefix: %s", prefix)
|
||||
}
|
||||
category := prefix[:keyLen] // prefix length
|
||||
ids = iDB.db.GetItemIDs(utils.CachePrefixToInstance[category], prefix)
|
||||
if len(ids) == 0 {
|
||||
return nil, utils.ErrNotFound
|
||||
}
|
||||
return
|
||||
return iDB.db.GetItemIDs(utils.CachePrefixToInstance[category], prefix), nil
|
||||
}
|
||||
|
||||
func (iDB *InternalDB) RebuildReverseForPrefix(prefix string) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user