diff --git a/engine/storage_map.go b/engine/storage_map.go index 82dca2f51..84f5547cf 100644 --- a/engine/storage_map.go +++ b/engine/storage_map.go @@ -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 } diff --git a/engine/storage_mongo_datadb.go b/engine/storage_mongo_datadb.go index 5c78ee184..32dd40197 100644 --- a/engine/storage_mongo_datadb.go +++ b/engine/storage_mongo_datadb.go @@ -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 } diff --git a/engine/storage_redis.go b/engine/storage_redis.go index 2337d62c5..9ea09ccfc 100644 --- a/engine/storage_redis.go +++ b/engine/storage_redis.go @@ -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 }