From 6342c4a3e5f232d2990d080c8aee0a191d4d5c5c Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Wed, 13 Aug 2014 14:38:52 +0300 Subject: [PATCH 1/3] save *asap action timings with empty account id list --- engine/action_timing.go | 3 +++ scheduler/scheduler.go | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/engine/action_timing.go b/engine/action_timing.go index 6bfcea7d5..c636b6d99 100644 --- a/engine/action_timing.go +++ b/engine/action_timing.go @@ -217,6 +217,9 @@ func (at *ActionTiming) getActions() (as []*Action, err error) { } func (at *ActionTiming) Execute() (err error) { + if len(at.AccountIds) == 0 { // nothing to do if no accounts set + return + } at.resetStartTimeCache() aac, err := at.getActions() if err != nil { diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index 0bdc9f924..b926e8bf3 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -90,8 +90,13 @@ func (s *Scheduler) LoadActionTimings(storage engine.AccountingStorage) { isAsap = at.IsASAP() toBeSaved = toBeSaved || isAsap if isAsap { - engine.Logger.Info(fmt.Sprintf("Time for one time action on %v", key)) - go at.Execute() + if len(at.AccountIds) > 0 { + engine.Logger.Info(fmt.Sprintf("Time for one time action on %v", key)) + } + go func() { + at.Execute() + at.AccountIds = make([]string, 0) + }() // do not append it to the newAts list to be saved } else { now := time.Now() @@ -100,8 +105,9 @@ func (s *Scheduler) LoadActionTimings(storage engine.AccountingStorage) { continue } s.queue = append(s.queue, at) - newAts = append(newAts, at) } + // save even asap action timings with empty account id list + newAts = append(newAts, at) } if toBeSaved { engine.AccLock.Guard(engine.ACTION_TIMING_PREFIX, func() (float64, error) { From 98996edc7e67fd4c7a6fdf9392c25d9fc2a0a00a Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Wed, 13 Aug 2014 14:44:13 +0300 Subject: [PATCH 2/3] drone.io is out of service --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 845d9cd8d..fe662e0e6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ ## Real-time Charging System for Telecom & ISP environments ## -[![Build Status](https://drone.io/github.com/cgrates/cgrates/status.png)](https://drone.io/github.com/cgrates/cgrates/latest) [![Build Status](https://secure.travis-ci.org/cgrates/cgrates.png)](http://travis-ci.org/cgrates/cgrates) +[![Build Status](https://secure.travis-ci.org/cgrates/cgrates.png)](http://travis-ci.org/cgrates/cgrates) ### Features ### + Rates for prepaid and for postpaid From b287c82ec37fce9a84f260ddd14d7c4c98daa91e Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Wed, 13 Aug 2014 14:47:37 +0300 Subject: [PATCH 3/3] removed drone.io badge --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index fe662e0e6..92a5524dc 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ ## Real-time Charging System for Telecom & ISP environments ## -[![Build Status](https://secure.travis-ci.org/cgrates/cgrates.png)](http://travis-ci.org/cgrates/cgrates) +[![Build Status](https://secure.travis-ci.org/cgrates/cgrates.png)](http://travis-ci.org/cgrates/cgrates) ### Features ### + Rates for prepaid and for postpaid