backend bugfixes

This commit is contained in:
Timo Volkmann 2021-01-11 01:18:38 +01:00
parent 730207c637
commit b4a3b09fb1
2 changed files with 8 additions and 7 deletions

View File

@ -61,17 +61,18 @@ func (p *pipelineReplay) channelFromTracking(t *Tracking) chan interface{} {
durationSinceLastEvent := t.Data[i].Servertime.UnixNano() - lastTs
timeCounter := time.Now().UTC().UnixNano() - lastTsNow
if timeCounter >= durationSinceLastEvent {
select {
case <-p.stopChan:
logrus.Debugln("received stop signal: replay stopped")
break br
case ch <- &(t.Data[i]):
}
logrus.Traceln("replay tracking: ", t.Data[i])
ch <- &(t.Data[i])
lastTs = t.Data[i].Servertime.UnixNano()
lastTsNow = time.Now().UTC().UnixNano()
i++
}
select {
case <-p.stopChan:
logrus.Debugln("received stop signal: replay stopped")
break br
default:
}
}
logrus.Infoln("replay: tracking replay finished")
select {

View File

@ -243,12 +243,12 @@ func (t *TrackingService) LoadTracking(trackingId uuid.UUID, replay bool) (*Trac
}
t.safelyReplaceTracking(*tracking)
if t.replaypipe != nil {
t.replaypipe = nil
select {
case <-t.replaypipe.stopChan:
logrus.Warnln("blocking channel closed")
default:
}
t.replaypipe = nil
}
t.replaypipe = NewReplayPipeline(t.publisher, t.tracking)
t.publisher.SetStreaming(true)