diff --git a/core/pipeline_replay.go b/core/pipeline_replay.go index 08a2db2..096f153 100644 --- a/core/pipeline_replay.go +++ b/core/pipeline_replay.go @@ -63,8 +63,11 @@ func (p *pipelineReplay) channelFromTracking(t *Tracking) chan interface{} { i++ } } - logrus.Infoln("replay: tracking replay finished") + select { + case <-p.stopChan: + logrus.Debugln("replay pipeline closed") + } }() return ch } diff --git a/core/service.go b/core/service.go index 87df9a7..902a4dd 100644 --- a/core/service.go +++ b/core/service.go @@ -140,6 +140,7 @@ func (t *TrackingService) StartLivetracking(cols ...CollectorType) (string, erro // finally create pipeline NewRecordPipeline(t.publisher, t, tcp, ser) t.publisher.SetStreaming(true) + logrus.Debugln("current State:", t.opMode) return "LIVE", nil } @@ -148,6 +149,7 @@ func (t *TrackingService) StartLivetracking(cols ...CollectorType) (string, erro func (t *TrackingService) AllTrackings() ([]TrackingMetadata, error) { logrus.Info("SERVICE: GET ALL TRACKINGS") data, err := t.store.LoadAll() + logrus.Debugln("current State:", t.opMode) return data, err } @@ -168,6 +170,7 @@ func (t *TrackingService) StartRecord() (string, error) { t.opMode = RECORDING t.tracking.TimeCreated = time.Now() t.SetRecording(true) + logrus.Debugln("current State:", t.opMode) return "record started at: " + t.tracking.TimeCreated.String(), nil } @@ -191,6 +194,7 @@ func (t *TrackingService) StopRecord() (*TrackingMetadata, error) { tm := t.tracking.TrackingMetadata t.safelyReplaceTracking(newTracking()) t.tracking.Collectors = tm.Collectors + logrus.Debugln("current State:", t.opMode) return &tm, err } @@ -214,12 +218,14 @@ func (t *TrackingService) StopAll() (*TrackingMetadata, error) { tm, err = t.StopRecord() } t.opMode = STOPPED + logrus.Debugln("current State:", t.opMode) return tm, err } // retrieves tracking with all data and starts replay pipeline if desired. // in that case the application behaves like in live mode. func (t *TrackingService) LoadTracking(trackingId uuid.UUID, replay bool) (*Tracking, error) { + logrus.Info("SERVICE: LOAD TRACKING") if t.opMode == RECORDING { txt := "trackingservice: please stop recording before load another tracking" logrus.Warn(txt) @@ -245,6 +251,7 @@ func (t *TrackingService) LoadTracking(trackingId uuid.UUID, replay bool) (*Trac t.replaypipe = NewReplayPipeline(t.publisher, t.tracking) t.publisher.SetStreaming(true) t.opMode = REPLAY + logrus.Debugln("current State:", t.opMode) return t.tracking, nil }