revid: do more thinking about errors in processFrom

This commit is contained in:
Saxon 2020-01-17 16:23:28 +10:30
parent e45f51a31f
commit 399ecb8874
1 changed files with 7 additions and 2 deletions

View File

@ -847,7 +847,12 @@ func (r *Revid) Update(vars map[string]string) error {
// processFrom is run as a routine to read from a input data source, lex and
// then send individual access units to revid's encoders.
func (r *Revid) processFrom(read io.Reader, delay time.Duration) {
r.err <- r.lexTo(r.filters[0], read, delay)
r.cfg.Logger.Log(logger.Info, pkg+"finished lexing")
err := r.lexTo(r.filters[0], read, delay)
switch {
case err == nil: // Do nothing.
case errors.Is(err, io.EOF): // TODO: handle this depending on loop mode.
default:
r.err <- err
}
r.wg.Done()
}