diff --git a/apier/v1/apier_local_test.go b/apier/v1/apier_local_test.go index 12144cfbf..794445581 100644 --- a/apier/v1/apier_local_test.go +++ b/apier/v1/apier_local_test.go @@ -740,7 +740,6 @@ func TestApierSetRatingProfile(t *testing.T) { if err := rater.Call("ApierV1.SetRatingProfile", rpf, &reply); err != nil { t.Error("Unexpected result on duplication: ", err.Error()) } - time.Sleep(10 * time.Millisecond) // Give time for cache reload // Make sure rates were loaded for account dan // Test here ResponderGetCost tStart, _ := utils.ParseDate("2013-08-07T17:30:00Z") @@ -1074,7 +1073,7 @@ func TestApierSetAccount(t *testing.T) { return } reply := "" - attrs := &utils.AttrSetAccount{Tenant: "cgrates.org", Account: "dan7", ActionPlanId: "ATMS_1"} + attrs := &utils.AttrSetAccount{Tenant: "cgrates.org", Account: "dan7", ActionPlanId: "ATMS_1", ReloadScheduler: true} if err := rater.Call("ApierV1.SetAccount", attrs, &reply); err != nil { t.Error("Got error on ApierV1.SetAccount: ", err.Error()) } else if reply != "OK" { @@ -1174,7 +1173,7 @@ func TestApierTriggersExecute(t *testing.T) { return } reply := "" - attrs := &utils.AttrSetAccount{Tenant: "cgrates.org", Account: "dan8"} + attrs := &utils.AttrSetAccount{Tenant: "cgrates.org", Account: "dan8", ReloadScheduler: true} if err := rater.Call("ApierV1.SetAccount", attrs, &reply); err != nil { t.Error("Got error on ApierV1.SetAccount: ", err.Error()) } else if reply != "OK" { diff --git a/cmd/cgr-loader/migrator_rc8.go b/cmd/cgr-loader/migrator_rc8.go index fcddea1f7..5f5b29671 100644 --- a/cmd/cgr-loader/migrator_rc8.go +++ b/cmd/cgr-loader/migrator_rc8.go @@ -491,7 +491,9 @@ func (mig MigratorRC8) migrateActionPlans() error { } if !apl.IsASAP() { for _, accID := range apl.AccountIds { - newApl.AccountIDs[accID] = struct{}{} + if _, exists := newApl.AccountIDs[accID]; !exists { + newApl.AccountIDs[accID] = struct{}{} + } } } newApl.ActionTimings = append(newApl.ActionTimings, &engine.ActionTiming{ diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index ac5e35d63..30afa0814 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -105,6 +105,7 @@ func (s *Scheduler) loadActionPlans() { } limit <- true go func() { + utils.Logger.Info(fmt.Sprintf(" executing task %s on account %s", task.ActionsID, task.AccountID)) task.Execute() <-limit }()