Skip to content

Commit d8d16be

Browse files
committed
IC-40 Shows aggregation progress
1 parent 819c0f3 commit d8d16be

File tree

1 file changed

+6
-7
lines changed
  • src/main/scala/com/intenthq/action_processor/integrations/aggregations

1 file changed

+6
-7
lines changed

src/main/scala/com/intenthq/action_processor/integrations/aggregations/Aggregate.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@ object Aggregate {
5252
.flatTap { aggRepository =>
5353
fs2.Stream.eval_(IO.delay(println("Starting aggregation"))) ++
5454
in.evalTap { o =>
55-
IO.sleep(1.second) >>
56-
IO.delay {
57-
keys(o).foreach { value =>
58-
val previousCounter = aggRepository.getOrDefault(value, 0L)
59-
aggRepository.put(value, counter(o) + previousCounter)
60-
}
55+
IO.delay {
56+
keys(o).foreach { value =>
57+
val previousCounter = aggRepository.getOrDefault(value, 0L)
58+
aggRepository.put(value, counter(o) + previousCounter)
6159
}
62-
}.through(AggregationsProgress.showAggregationProgress(1.millis))
60+
}
61+
}.through(AggregationsProgress.showAggregationProgress(5.seconds))
6362
.as(1)
6463
.foldMonoid
6564
.evalMap(n => IO.delay(println(s"Finished aggregation of $n rows")))

0 commit comments

Comments
 (0)