Apier SetAccount reloading always scheduler for repetitive scenarios using same actionPlan

This commit is contained in:
DanB
2017-02-17 21:10:54 +01:00
parent 00fc841e43
commit dd8ba0087f
3 changed files with 3 additions and 3 deletions

View File

@@ -190,7 +190,7 @@ func (self *ApierV1) SetAccount(attr utils.AttrSetAccount, reply *string) (err e
// clean previous action plans
for i := 0; i < len(acntAPids); {
apID := acntAPids[i]
if attr.ActionPlanId == apID {
if apID == attr.ActionPlanId {
i++ // increase index since we don't remove from slice
continue
}
@@ -276,7 +276,7 @@ func (self *ApierV1) SetAccount(attr utils.AttrSetAccount, reply *string) (err e
if err != nil {
return utils.NewErrServerError(err)
}
if attr.ReloadScheduler && len(dirtyActionPlans) > 0 {
if attr.ReloadScheduler {
sched := self.ServManager.GetScheduler()
if sched == nil {
return errors.New(utils.SchedulerNotRunningCaps)

View File

@@ -227,7 +227,7 @@ func (self *ApierV2) SetAccount(attr AttrSetAccount, reply *string) error {
if err != nil {
return utils.NewErrServerError(err)
}
if attr.ReloadScheduler && len(dirtyActionPlans) > 0 {
if attr.ReloadScheduler {
sched := self.ServManager.GetScheduler()
if sched == nil {
return errors.New(utils.SchedulerNotRunningCaps)