Skip to content

Commit 2148e3b

Browse files
authored
Merge pull request #101 from nomisRev/fix-commit-strategy
Remove duplicate constructor param
2 parents 558517b + 2386a09 commit 2148e3b

File tree

1 file changed

+2
-5
lines changed
  • src/main/kotlin/io/github/nomisRev/kafka/receiver/internals

1 file changed

+2
-5
lines changed

src/main/kotlin/io/github/nomisRev/kafka/receiver/internals/PollLoop.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.nomisRev.kafka.receiver.internals
22

3-
import io.github.nomisRev.kafka.receiver.CommitStrategy
43
import io.github.nomisRev.kafka.receiver.Offset
54
import io.github.nomisRev.kafka.receiver.ReceiverSettings
65
import io.github.nomisRev.kafka.receiver.size
@@ -37,7 +36,6 @@ import kotlin.coroutines.Continuation
3736
import kotlin.coroutines.resume
3837
import kotlin.coroutines.resumeWithException
3938
import kotlin.coroutines.suspendCoroutine
40-
import kotlin.time.Duration.Companion.seconds
4139
import kotlin.time.toJavaDuration
4240

4341
internal class PollLoop<K, V>(
@@ -48,7 +46,6 @@ internal class PollLoop<K, V>(
4846
scope: CoroutineScope,
4947
awaitingTransaction: AtomicBoolean = AtomicBoolean(false),
5048
private val isActive: AtomicBoolean = AtomicBoolean(true),
51-
private val commitStrategy: CommitStrategy = CommitStrategy.BySizeOrTime(5, 5.seconds),
5249
private val ackMode: AckMode = AckMode.MANUAL_ACK,
5350
isRetriableException: (Throwable) -> Boolean = { e -> e is RetriableCommitFailedException },
5451
) {
@@ -78,7 +75,7 @@ internal class PollLoop<K, V>(
7875
) {
7976
offsetCommitWorker(
8077
ackMode,
81-
commitStrategy,
78+
settings.commitStrategy,
8279
reachedMaxCommitBatchSize,
8380
loop::scheduleCommitIfRequired
8481
)
@@ -105,7 +102,7 @@ internal class PollLoop<K, V>(
105102
TopicPartition(record.topic(), record.partition()),
106103
record.offset(),
107104
loop,
108-
commitStrategy.size(),
105+
settings.commitStrategy.size(),
109106
reachedMaxCommitBatchSize
110107
)
111108
}

0 commit comments

Comments
 (0)