mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
Storage.GetActions using GetCloned
This commit is contained in:
@@ -563,11 +563,14 @@ func (ms *MapStorage) GetActions(key string, skipCache bool, transactionID strin
|
||||
cCommit := cacheCommit(transactionID)
|
||||
key = utils.ACTION_PREFIX + key
|
||||
if !skipCache {
|
||||
if x, ok := cache.Get(key); ok {
|
||||
if x != nil {
|
||||
return x.(Actions), nil
|
||||
if x, err := cache.GetCloned(key); err != nil {
|
||||
if err.Error() != utils.ItemNotFound {
|
||||
return nil, err
|
||||
}
|
||||
} else if x == nil {
|
||||
return nil, utils.ErrNotFound
|
||||
} else {
|
||||
return x.(Actions), nil
|
||||
}
|
||||
}
|
||||
if values, ok := ms.dict[key]; ok {
|
||||
|
||||
@@ -896,11 +896,14 @@ func (ms *MongoStorage) UpdateReverseDestination(oldDest, newDest *Destination,
|
||||
|
||||
func (ms *MongoStorage) GetActions(key string, skipCache bool, transactionID string) (as Actions, err error) {
|
||||
if !skipCache {
|
||||
if x, ok := cache.Get(utils.ACTION_PREFIX + key); ok {
|
||||
if x != nil {
|
||||
return x.(Actions), nil
|
||||
if x, err := cache.GetCloned(utils.ACTION_PREFIX + key); err != nil {
|
||||
if err.Error() != utils.ItemNotFound {
|
||||
return nil, err
|
||||
}
|
||||
} else if x == nil {
|
||||
return nil, utils.ErrNotFound
|
||||
} else {
|
||||
return x.(Actions), nil
|
||||
}
|
||||
}
|
||||
var result struct {
|
||||
|
||||
@@ -572,11 +572,14 @@ func (rs *RedisStorage) UpdateReverseDestination(oldDest, newDest *Destination,
|
||||
func (rs *RedisStorage) GetActions(key string, skipCache bool, transactionID string) (as Actions, err error) {
|
||||
key = utils.ACTION_PREFIX + key
|
||||
if !skipCache {
|
||||
if x, ok := cache.Get(key); ok {
|
||||
if x != nil {
|
||||
return x.(Actions), nil
|
||||
if x, err := cache.GetCloned(key); err != nil {
|
||||
if err.Error() != utils.ItemNotFound {
|
||||
return nil, err
|
||||
}
|
||||
} else if x == nil {
|
||||
return nil, utils.ErrNotFound
|
||||
} else {
|
||||
return x.(Actions), nil
|
||||
}
|
||||
}
|
||||
var values []byte
|
||||
|
||||
Reference in New Issue
Block a user