mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 05:39:54 +05:00
AccountActionPlans processed in TPReader
This commit is contained in:
@@ -74,7 +74,7 @@ type RatingStorage interface {
|
||||
GetAllActionPlans() (map[string]*ActionPlan, error)
|
||||
GetAccountActionPlans(acntID string, skipCache bool, transactionID string) (apIDs []string, err error)
|
||||
SetAccountActionPlans(acntID string, apIDs []string, overwrite bool) (err error)
|
||||
|
||||
RemAccountActionPlans(acntID string, aPlIDs []string) (err error)
|
||||
PushTask(*Task) error
|
||||
PopTask() (*Task, error)
|
||||
// CacheDataFromDB loads data to cache, prefix represents the cache prefix, IDs should be nil if all available data should be loaded
|
||||
|
||||
@@ -885,7 +885,6 @@ func (tpr *TpReader) LoadAccountActionsFiltered(qriedAA *TpAccountAction) error
|
||||
exitingAccountIds[id] = true
|
||||
actionPlan.AccountIDs = exitingAccountIds
|
||||
}
|
||||
|
||||
// write tasks
|
||||
for _, at := range actionPlan.ActionTimings {
|
||||
if at.IsASAP() {
|
||||
@@ -902,10 +901,15 @@ func (tpr *TpReader) LoadAccountActionsFiltered(qriedAA *TpAccountAction) error
|
||||
}
|
||||
}
|
||||
// write action plan
|
||||
err = tpr.ratingStorage.SetActionPlan(accountAction.ActionPlanId, actionPlan, false, utils.NonTransactional)
|
||||
if err != nil {
|
||||
if err = tpr.ratingStorage.SetActionPlan(accountAction.ActionPlanId, actionPlan, false, utils.NonTransactional); err != nil {
|
||||
return errors.New(err.Error() + " (SetActionPlan): " + accountAction.ActionPlanId)
|
||||
}
|
||||
if err = tpr.ratingStorage.SetAccountActionPlans(id, []string{accountAction.ActionPlanId}, false); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = tpr.ratingStorage.CacheDataFromDB(utils.AccountActionPlansPrefix, []string{id}, true); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// action triggers
|
||||
var actionTriggers ActionTriggers
|
||||
|
||||
Reference in New Issue
Block a user