示例#1
0
func NewSMGeneric(cgrCfg *config.CGRConfig, rater rpcclient.RpcClientConnection, cdrsrv rpcclient.RpcClientConnection,
	smgReplConns []*SMGReplicationConn, timezone string) *SMGeneric {
	return &SMGeneric{cgrCfg: cgrCfg,
		rater:              rater,
		cdrsrv:             cdrsrv,
		smgReplConns:       smgReplConns,
		timezone:           timezone,
		activeSessions:     make(map[string][]*SMGSession),
		aSessionsIndex:     make(map[string]map[string]utils.StringMap),
		passiveSessions:    make(map[string][]*SMGSession),
		sessionTerminators: make(map[string]*smgSessionTerminator),
		responseCache:      cache.NewResponseCache(cgrCfg.ResponseCacheTTL)}
}
示例#2
0
func NewSMGeneric(cgrCfg *config.CGRConfig, rals rpcclient.RpcClientConnection, cdrsrv rpcclient.RpcClientConnection,
	smgReplConns []*SMGReplicationConn, timezone string) *SMGeneric {
	ssIdxCfg := cgrCfg.SmGenericConfig.SessionIndexes
	ssIdxCfg[utils.ACCID] = true // Make sure we have indexing for OriginID since it is a requirement on prefix searching
	return &SMGeneric{cgrCfg: cgrCfg,
		rals:               rals,
		cdrsrv:             cdrsrv,
		smgReplConns:       smgReplConns,
		Timezone:           timezone,
		activeSessions:     make(map[string][]*SMGSession),
		ssIdxCfg:           ssIdxCfg,
		aSessionsIndex:     make(map[string]map[string]map[string]utils.StringMap),
		aSessionsRIndex:    make(map[string][]*riFieldNameVal),
		passiveSessions:    make(map[string][]*SMGSession),
		pSessionsIndex:     make(map[string]map[string]map[string]utils.StringMap),
		pSessionsRIndex:    make(map[string][]*riFieldNameVal),
		sessionTerminators: make(map[string]*smgSessionTerminator),
		responseCache:      cache.NewResponseCache(cgrCfg.ResponseCacheTTL)}
}
示例#3
0
func (rs *Responder) getCache() *cache.ResponseCache {
	if rs.responseCache == nil {
		rs.responseCache = cache.NewResponseCache(0)
	}
	return rs.responseCache
}
示例#4
0
func (rs *Responder) SetTimeToLive(timeToLive time.Duration, out *int) error {
	rs.responseCache = cache.NewResponseCache(timeToLive)
	return nil
}
示例#5
0
文件: cdrs.go 项目: cgrates/cgrates
func (self *CdrServer) getCache() *cache.ResponseCache {
	if self.responseCache == nil {
		self.responseCache = cache.NewResponseCache(0)
	}
	return self.responseCache
}
示例#6
0
文件: cdrs.go 项目: cgrates/cgrates
func (self *CdrServer) SetTimeToLive(timeToLive time.Duration, out *int) error {
	self.responseCache = cache.NewResponseCache(timeToLive)
	return nil
}