Set progress in a linear way between each step

This commit is contained in:
Eike Kettner 2020-05-23 15:33:58 +02:00
parent e2fc13673e
commit 855d4eefa8

View File

@ -12,11 +12,13 @@ object ProcessItem {
cfg: Config
)(item: ItemData): Task[F, ProcessItemArgs, ItemData] =
ExtractArchive(item)
.flatMap(Task.setProgress(20))
.flatMap(ConvertPdf(cfg.convert, _))
.flatMap(Task.setProgress(40))
.flatMap(TextExtraction(cfg.extraction, _))
.flatMap(Task.setProgress(50))
.flatMap(Task.setProgress(60))
.flatMap(analysisOnly[F](cfg.textAnalysis))
.flatMap(Task.setProgress(75))
.flatMap(Task.setProgress(80))
.flatMap(LinkProposal[F])
.flatMap(Task.setProgress(99))