Skip to content

Commit

Permalink
Specify max to throttle argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Sep 16, 2022
1 parent 0ce62b1 commit 627b64b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ trait S3Spec
): Source[ProducerRecord[Array[Byte], Array[Byte]], NotUsed] = {
val durationToMicros = streamDuration.toMillis
val topicsPerMillis = producerRecords.size / durationToMicros
Source(producerRecords).throttle(topicsPerMillis.toInt, 1 millis)
Source(producerRecords).throttle(topicsPerMillis.toInt max 1, 1 millis)
}

/** Converts a generated list of `ReducedConsumerRecord` to a list of `ProducerRecord`
Expand Down

0 comments on commit 627b64b

Please sign in to comment.