mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 10:36:24 +05:00
Merge branch 'master' of https://github.com/cgrates/cgrates
This commit is contained in:
@@ -77,6 +77,9 @@ func (sq *StatsQueue) UpdateConf(conf *CdrStats) {
|
||||
defer sq.mux.Unlock()
|
||||
// check if new conf asks for action trigger reset only
|
||||
if sq.conf != nil && (conf.hasGeneralConfigs() || sq.conf.equalExceptTriggers(conf)) {
|
||||
for _, trigger := range conf.Triggers {
|
||||
trigger.LastExecutionTime = sq.GetTriggerLastExecution(&trigger.ID)
|
||||
}
|
||||
sq.conf.Triggers = conf.Triggers
|
||||
return
|
||||
}
|
||||
@@ -172,6 +175,15 @@ func (sq *StatsQueue) appendQcdr(qcdr *QCdr, runTrigger bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (sq *StatsQueue) GetTriggerLastExecution(trigger_id *string) time.Time {
|
||||
for _, trigger := range sq.conf.Triggers {
|
||||
if trigger.ID == *trigger_id {
|
||||
return trigger.LastExecutionTime
|
||||
}
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (sq *StatsQueue) addToMetrics(cdr *QCdr) {
|
||||
//log.Print("AddToMetrics: " + utils.ToIJSON(cdr))
|
||||
for _, metric := range sq.metrics {
|
||||
|
||||
Reference in New Issue
Block a user