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
|
durationSinceLastEvent := t.Data[i].Servertime.UnixNano() - lastTs
|
||||||
timeCounter := time.Now().UTC().UnixNano() - lastTsNow
|
timeCounter := time.Now().UTC().UnixNano() - lastTsNow
|
||||||
if timeCounter >= durationSinceLastEvent {
|
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])
|
logrus.Traceln("replay tracking: ", t.Data[i])
|
||||||
|
ch <- &(t.Data[i])
|
||||||
lastTs = t.Data[i].Servertime.UnixNano()
|
lastTs = t.Data[i].Servertime.UnixNano()
|
||||||
lastTsNow = time.Now().UTC().UnixNano()
|
lastTsNow = time.Now().UTC().UnixNano()
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
select {
|
||||||
|
case <-p.stopChan:
|
||||||
|
logrus.Debugln("received stop signal: replay stopped")
|
||||||
|
break br
|
||||||
|
default:
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logrus.Infoln("replay: tracking replay finished")
|
logrus.Infoln("replay: tracking replay finished")
|
||||||
select {
|
select {
|
||||||
|
|||||||
@ -243,12 +243,12 @@ func (t *TrackingService) LoadTracking(trackingId uuid.UUID, replay bool) (*Trac
|
|||||||
}
|
}
|
||||||
t.safelyReplaceTracking(*tracking)
|
t.safelyReplaceTracking(*tracking)
|
||||||
if t.replaypipe != nil {
|
if t.replaypipe != nil {
|
||||||
t.replaypipe = nil
|
|
||||||
select {
|
select {
|
||||||
case <-t.replaypipe.stopChan:
|
case <-t.replaypipe.stopChan:
|
||||||
logrus.Warnln("blocking channel closed")
|
logrus.Warnln("blocking channel closed")
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
t.replaypipe = nil
|
||||||
}
|
}
|
||||||
t.replaypipe = NewReplayPipeline(t.publisher, t.tracking)
|
t.replaypipe = NewReplayPipeline(t.publisher, t.tracking)
|
||||||
t.publisher.SetStreaming(true)
|
t.publisher.SetStreaming(true)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user