This commit is contained in:
Alex Yatskov 2015-12-18 22:05:19 +09:00
parent 12e62912c8
commit 5aae6ed383
2 changed files with 7 additions and 5 deletions

View File

@ -86,13 +86,15 @@ func (s *stage) chain(p Plugin) {
wg.Add(1)
go func(f *file) {
defer wg.Done()
f.rewind()
if err := proc.Process(s, f); err != nil {
keep, err := proc.Process(s, f)
if err != nil {
s.gs.fault(s, "Processing", f, err)
}
} else if keep {
dispatch(f)
} else {
atomic.AddInt64(&s.gs.active, -1)
}
}(f)
}
}

View File

@ -96,5 +96,5 @@ type Finalizer interface {
}
type Processor interface {
Process(ctx Context, f File) error
Process(ctx Context, f File) (bool, error)
}