|
|
@ -225,6 +225,12 @@ func Run(opts *Options, revision string) {
|
|
|
|
reading := true
|
|
|
|
reading := true
|
|
|
|
ticks := 0
|
|
|
|
ticks := 0
|
|
|
|
var nextCommand *string
|
|
|
|
var nextCommand *string
|
|
|
|
|
|
|
|
restart := func(command string) {
|
|
|
|
|
|
|
|
reading = true
|
|
|
|
|
|
|
|
chunkList.Clear()
|
|
|
|
|
|
|
|
header = make([]string, 0, opts.HeaderLines)
|
|
|
|
|
|
|
|
go reader.restart(command)
|
|
|
|
|
|
|
|
}
|
|
|
|
eventBox.Watch(EvtReadNew)
|
|
|
|
eventBox.Watch(EvtReadNew)
|
|
|
|
for {
|
|
|
|
for {
|
|
|
|
delay := true
|
|
|
|
delay := true
|
|
|
@ -245,9 +251,8 @@ func Run(opts *Options, revision string) {
|
|
|
|
case EvtReadNew, EvtReadFin:
|
|
|
|
case EvtReadNew, EvtReadFin:
|
|
|
|
clearCache := false
|
|
|
|
clearCache := false
|
|
|
|
if evt == EvtReadFin && nextCommand != nil {
|
|
|
|
if evt == EvtReadFin && nextCommand != nil {
|
|
|
|
chunkList.Clear()
|
|
|
|
|
|
|
|
clearCache = true
|
|
|
|
clearCache = true
|
|
|
|
go reader.restart(*nextCommand)
|
|
|
|
restart(*nextCommand)
|
|
|
|
nextCommand = nil
|
|
|
|
nextCommand = nil
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
reading = reading && evt == EvtReadNew
|
|
|
|
reading = reading && evt == EvtReadNew
|
|
|
@ -271,9 +276,7 @@ func Run(opts *Options, revision string) {
|
|
|
|
reader.terminate()
|
|
|
|
reader.terminate()
|
|
|
|
nextCommand = command
|
|
|
|
nextCommand = command
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
reading = true
|
|
|
|
restart(*command)
|
|
|
|
chunkList.Clear()
|
|
|
|
|
|
|
|
go reader.restart(*command)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
snapshot, _ := chunkList.Snapshot()
|
|
|
|
snapshot, _ := chunkList.Snapshot()
|
|
|
|