From 5496a0eae21f5114d27ac78e82271a01f2ee6154 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Fri, 1 Aug 2014 21:25:39 +0300 Subject: [PATCH] better update queues --- engine/cdrstats.go | 3 +++ engine/stats.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/cdrstats.go b/engine/cdrstats.go index c4b293204..2074763b2 100644 --- a/engine/cdrstats.go +++ b/engine/cdrstats.go @@ -76,6 +76,9 @@ type CdrStats struct { } func (cs *CdrStats) AcceptCdr(cdr *utils.StoredCdr) bool { + if cdr == nil { + return false + } if len(cs.SetupInterval) > 0 { if cdr.SetupTime.Before(cs.SetupInterval[0]) { return false diff --git a/engine/stats.go b/engine/stats.go index bc4f4ed1d..2580c9b4d 100644 --- a/engine/stats.go +++ b/engine/stats.go @@ -148,7 +148,7 @@ func (s *Stats) UpdateQueues(css []*CdrStats, out *int) error { var existing bool if oldQueues != nil { if sq, existing = oldQueues[cs.Id]; existing { - sq.conf = cs + sq.UpdateConf(cs) } } if sq == nil {