diff options
Diffstat (limited to 'internal/pipeline/pipeline.go')
-rw-r--r-- | internal/pipeline/pipeline.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/pipeline/pipeline.go b/internal/pipeline/pipeline.go index e1a2c40..d5e8e1c 100644 --- a/internal/pipeline/pipeline.go +++ b/internal/pipeline/pipeline.go @@ -467,11 +467,16 @@ func Analyse(conn Downloader) func(chan string, chan string, chan error, *log.Lo } defer f.Close() err = bookpipeline.Graph(bestconfs, filepath.Base(savedir), f) + if err != nil { + _ = os.Remove(fn) + } if err != nil && err.Error() != "Not enough valid confidences" { errc <- fmt.Errorf("Error rendering graph: %s", err) return } - up <- fn + if err == nil { + up <- fn + } close(up) } |