mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
fixes for keeping account ids
This commit is contained in:
@@ -672,7 +672,10 @@ func (ms *MapStorage) SetActionPlan(key string, ats *ActionPlan) (err error) {
|
||||
return
|
||||
}
|
||||
// get existing action plan to merge the account ids
|
||||
if existingAts, _ := ms.GetActionPlan(utils.ACTION_PLAN_PREFIX, true); existingAts != nil {
|
||||
if existingAts, _ := ms.GetActionPlan(key, true); existingAts != nil {
|
||||
if ats.AccountIDs == nil && len(existingAts.AccountIDs) > 0 {
|
||||
ats.AccountIDs = make(utils.StringMap)
|
||||
}
|
||||
for accID := range existingAts.AccountIDs {
|
||||
ats.AccountIDs[accID] = true
|
||||
}
|
||||
|
||||
@@ -1167,7 +1167,10 @@ func (ms *MongoStorage) SetActionPlan(key string, ats *ActionPlan) error {
|
||||
return nil
|
||||
}
|
||||
// get existing action plan to merge the account ids
|
||||
if existingAts, _ := ms.GetActionPlan(utils.ACTION_PLAN_PREFIX, true); existingAts != nil {
|
||||
if existingAts, _ := ms.GetActionPlan(key, true); existingAts != nil {
|
||||
if ats.AccountIDs == nil && len(existingAts.AccountIDs) > 0 {
|
||||
ats.AccountIDs = make(utils.StringMap)
|
||||
}
|
||||
for accID := range existingAts.AccountIDs {
|
||||
ats.AccountIDs[accID] = true
|
||||
}
|
||||
|
||||
@@ -928,7 +928,10 @@ func (rs *RedisStorage) SetActionPlan(key string, ats *ActionPlan) (err error) {
|
||||
return err
|
||||
}
|
||||
// get existing action plan to merge the account ids
|
||||
if existingAts, _ := rs.GetActionPlan(utils.ACTION_PLAN_PREFIX, true); existingAts != nil {
|
||||
if existingAts, _ := rs.GetActionPlan(key, true); existingAts != nil {
|
||||
if ats.AccountIDs == nil && len(existingAts.AccountIDs) > 0 {
|
||||
ats.AccountIDs = make(utils.StringMap)
|
||||
}
|
||||
for accID := range existingAts.AccountIDs {
|
||||
ats.AccountIDs[accID] = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user