backend bugfixes
This commit is contained in:
parent
730207c637
commit
b4a3b09fb1
@ -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 {
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user