mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
build fix
This commit is contained in:
@@ -21,9 +21,10 @@ package apier
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AttrAcntAction struct {
|
||||
@@ -51,7 +52,7 @@ func (self *ApierV1) GetAccountActionPlan(attrs AttrAcntAction, reply *[]*Accoun
|
||||
for _, ats := range allATs {
|
||||
for _, at := range ats {
|
||||
if utils.IsSliceMember(at.UserBalanceIds, utils.BalanceKey(attrs.Tenant, attrs.Account, attrs.Direction)) {
|
||||
accountATs = append(accountATs, &AccountActionTiming{Id: at.Id, ActionPlanId: at.Tag, ActionsId: at.ActionsId, NextExecTime: at.GetNextStartTime()})
|
||||
accountATs = append(accountATs, &AccountActionTiming{Id: at.Id, ActionPlanId: at.Tag, ActionsId: at.ActionsId, NextExecTime: at.GetNextStartTime(time.Now())})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func (s *Scheduler) Loop() {
|
||||
s.Lock()
|
||||
a0 := s.queue[0]
|
||||
now := time.Now()
|
||||
if a0.GetNextStartTime().Equal(now) || a0.GetNextStartTime().Before(now) {
|
||||
if a0.GetNextStartTime(now).Equal(now) || a0.GetNextStartTime(now).Before(now) {
|
||||
engine.Logger.Debug(fmt.Sprintf("%v - %v", a0.Tag, a0.Timing))
|
||||
go a0.Execute()
|
||||
s.queue = append(s.queue, a0)
|
||||
@@ -55,7 +55,7 @@ func (s *Scheduler) Loop() {
|
||||
s.Unlock()
|
||||
} else {
|
||||
s.Unlock()
|
||||
d := a0.GetNextStartTime().Sub(now)
|
||||
d := a0.GetNextStartTime(now).Sub(now)
|
||||
// engine.Logger.Info(fmt.Sprintf("Timer set to wait for %v", d))
|
||||
s.timer = time.NewTimer(d)
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user