minor fixes

This commit is contained in:
Radu Ioan Fericean
2015-12-18 17:12:36 +02:00
parent ef5c6c78a7
commit c18d2ce2ba
3 changed files with 6 additions and 4 deletions

View File

@@ -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" {

View File

@@ -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{

View File

@@ -105,6 +105,7 @@ func (s *Scheduler) loadActionPlans() {
}
limit <- true
go func() {
utils.Logger.Info(fmt.Sprintf("<Scheduler> executing task %s on account %s", task.ActionsID, task.AccountID))
task.Execute()
<-limit
}()