From 41c76cc85ff6b61feae50465df32d1652df563e4 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 4 Aug 2015 12:08:01 +0300 Subject: [PATCH] removed split on days --- engine/calldesc.go | 16 ---------------- engine/timespans.go | 16 ---------------- 2 files changed, 32 deletions(-) diff --git a/engine/calldesc.go b/engine/calldesc.go index 026a02c57..6fcd0f793 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -348,22 +348,6 @@ func (cd *CallDescriptor) splitInTimeSpans() (timespans []*TimeSpan) { } } } - // split on days - /*for i := 0; i < len(timespans); i++ { - if timespans[i].TimeStart.Day() != timespans[i].TimeEnd.Day() { - //log.Print("TS: ", timespans[i].TimeStart, timespans[i].TimeEnd) - start := timespans[i].TimeStart - newTs := timespans[i].SplitByTime(time.Date(start.Year(), start.Month(), start.Day(), 0, 0, 0, 0, start.Location()).Add(24 * time.Hour)) - if newTs != nil { - //log.Print("NEW TS: ", newTs.TimeStart, newTs.TimeEnd) - // insert the new timespan - index := i + 1 - timespans = append(timespans, nil) - copy(timespans[index+1:], timespans[index:]) - timespans[index] = newTs - } - } - }*/ // Logger.Debug(fmt.Sprintf("After SplitByRatingPlan: %+v", timespans)) // split on rate intervals for i := 0; i < len(timespans); i++ { diff --git a/engine/timespans.go b/engine/timespans.go index a4197f9ec..efbb079cc 100644 --- a/engine/timespans.go +++ b/engine/timespans.go @@ -416,22 +416,6 @@ func (ts *TimeSpan) SplitByRateInterval(i *RateInterval, data bool) (nts *TimeSp return } -/*func (ts *TimeSpan) SplitByTime(splitTime time.Time) (nts *TimeSpan) { - if splitTime.Equal(ts.TimeEnd) { - return - } - nts = &TimeSpan{ - TimeStart: splitTime, - TimeEnd: ts.TimeEnd, - } - nts.copyRatingInfo(ts) - ts.TimeEnd = splitTime - nts.SetRateInterval(ts.RateInterval) - nts.DurationIndex = ts.DurationIndex - ts.SetNewDurationIndex(nts) - return -}*/ - // Split the timespan at the given increment start func (ts *TimeSpan) SplitByIncrement(index int) *TimeSpan { if index <= 0 || index >= len(ts.Increments) {