mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Removed old threshold connection from resources
This commit is contained in:
committed by
Dan Christian Bogos
parent
668d9b7874
commit
830103a200
@@ -28,7 +28,6 @@ import (
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/guardian"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
"github.com/cgrates/rpcclient"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -310,8 +309,7 @@ func NewResourceService(dm *DataManager, cgrcfg *config.CGRConfig,
|
||||
|
||||
// ResourceService is the service handling resources
|
||||
type ResourceService struct {
|
||||
dm *DataManager // So we can load the data in cache and index it
|
||||
thdS rpcclient.ClientConnector // allows applying filters based on stats
|
||||
dm *DataManager // So we can load the data in cache and index it
|
||||
filterS *FilterS
|
||||
storedResources utils.StringMap // keep a record of resources which need saving, map[resID]bool
|
||||
srMux sync.RWMutex // protects storedResources
|
||||
@@ -411,7 +409,7 @@ func (rS *ResourceService) runBackup() {
|
||||
|
||||
// processThresholds will pass the event for resource to ThresholdS
|
||||
func (rS *ResourceService) processThresholds(r *Resource, argDispatcher *utils.ArgDispatcher) (err error) {
|
||||
if rS.thdS == nil {
|
||||
if len(rS.cgrcfg.ResourceSCfg().ThresholdSConns) == 0 {
|
||||
return
|
||||
}
|
||||
var thIDs []string
|
||||
@@ -772,9 +770,3 @@ func (rS *ResourceService) Reload() {
|
||||
func (rS *ResourceService) StartLoop() {
|
||||
go rS.runBackup()
|
||||
}
|
||||
|
||||
// SetThresholdConnection sets the new connection to the threshold service
|
||||
// only used on reload
|
||||
func (rS *ResourceService) SetThresholdConnection(thdS rpcclient.ClientConnector) {
|
||||
rS.thdS = thdS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user