mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
added passing events from thresholds to ees
This commit is contained in:
committed by
Dan Christian Bogos
parent
90de059801
commit
ccdf3ef1f1
@@ -34,7 +34,7 @@ import (
|
||||
// NewThresholdService returns the Threshold Service
|
||||
func NewThresholdService(cfg *config.CGRConfig, dm *DataDBService,
|
||||
cacheS *engine.CacheS, filterSChan chan *engine.FilterS,
|
||||
server *cores.Server, internalThresholdSChan chan birpc.ClientConnector,
|
||||
server *cores.Server, internalThresholdSChan chan birpc.ClientConnector, connMgr *engine.ConnManager,
|
||||
anz *AnalyzerService, srvDep map[string]*sync.WaitGroup) servmanager.Service {
|
||||
return &ThresholdService{
|
||||
connChan: internalThresholdSChan,
|
||||
@@ -43,6 +43,7 @@ func NewThresholdService(cfg *config.CGRConfig, dm *DataDBService,
|
||||
cacheS: cacheS,
|
||||
filterSChan: filterSChan,
|
||||
server: server,
|
||||
connMgr: connMgr,
|
||||
anz: anz,
|
||||
srvDep: srvDep,
|
||||
}
|
||||
@@ -56,6 +57,7 @@ type ThresholdService struct {
|
||||
cacheS *engine.CacheS
|
||||
filterSChan chan *engine.FilterS
|
||||
server *cores.Server
|
||||
connMgr *engine.ConnManager
|
||||
|
||||
thrs *engine.ThresholdService
|
||||
connChan chan birpc.ClientConnector
|
||||
@@ -82,7 +84,7 @@ func (thrs *ThresholdService) Start() error {
|
||||
|
||||
thrs.Lock()
|
||||
defer thrs.Unlock()
|
||||
thrs.thrs = engine.NewThresholdService(datadb, thrs.cfg, filterS)
|
||||
thrs.thrs = engine.NewThresholdService(datadb, thrs.cfg, filterS, thrs.connMgr)
|
||||
|
||||
utils.Logger.Info(fmt.Sprintf("<%s> starting <%s> subsystem", utils.CoreS, utils.ThresholdS))
|
||||
thrs.thrs.StartLoop()
|
||||
|
||||
@@ -40,11 +40,11 @@ func TestThresholdSCoverage(t *testing.T) {
|
||||
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
|
||||
anz := NewAnalyzerService(cfg, server, filterSChan, shdChan, make(chan birpc.ClientConnector, 1), srvDep)
|
||||
db := NewDataDBService(cfg, nil, false, srvDep)
|
||||
tS := NewThresholdService(cfg, db, chS, filterSChan, server, make(chan birpc.ClientConnector, 1), anz, srvDep)
|
||||
tS := NewThresholdService(cfg, db, chS, filterSChan, server, make(chan birpc.ClientConnector, 1), nil, anz, srvDep)
|
||||
if tS.IsRunning() {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
thrs1 := engine.NewThresholdService(&engine.DataManager{}, &config.CGRConfig{}, &engine.FilterS{})
|
||||
thrs1 := engine.NewThresholdService(&engine.DataManager{}, &config.CGRConfig{}, &engine.FilterS{}, nil)
|
||||
tS2 := &ThresholdService{
|
||||
cfg: cfg,
|
||||
dm: db,
|
||||
|
||||
Reference in New Issue
Block a user