Skip to content

Commit dc2b78a

Browse files
Use java.time.Duration rather than kotlin.time.Duration for Exporter config.
jitsi-metaconfig doesn't have support for the Kotlin class.
1 parent 0360d04 commit dc2b78a

File tree

1 file changed

+3
-3
lines changed
  • jvb/src/main/kotlin/org/jitsi/videobridge/export

1 file changed

+3
-3
lines changed

jvb/src/main/kotlin/org/jitsi/videobridge/export/Exporter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ import org.jitsi.videobridge.util.TaskPools
3434
import org.jitsi.videobridge.websocket.config.WebsocketServiceConfig
3535
import org.json.simple.JSONObject
3636
import java.net.URI
37+
import java.time.Duration
3738
import java.util.concurrent.ScheduledFuture
3839
import java.util.concurrent.TimeUnit
3940
import java.util.concurrent.atomic.AtomicBoolean
4041
import java.util.concurrent.atomic.AtomicInteger
4142
import java.util.concurrent.atomic.AtomicLong
4243
import kotlin.math.min
4344
import kotlin.math.pow
44-
import kotlin.time.Duration
4545

4646
internal class Exporter(
4747
private val url: URI,
@@ -177,7 +177,7 @@ internal class Exporter(
177177
}
178178
}
179179

180-
val delayMs = if (maxDelay) Companion.maxDelay.inWholeMilliseconds else getDelayMs(attempt)
180+
val delayMs = if (maxDelay) Companion.maxDelay.toMillis() else getDelayMs(attempt)
181181
logger.info("Scheduling reconnection attempt $attempt in $delayMs ms")
182182

183183
cancelReconnect()
@@ -295,7 +295,7 @@ internal class Exporter(
295295
private fun getDelayMs(attempt: Int) = if (attempt == 1) {
296296
0
297297
} else {
298-
min(baseDelay.inWholeMilliseconds * 2.0.pow(attempt - 2).toLong(), maxDelay.inWholeMilliseconds)
298+
min(baseDelay.toMillis() * 2.0.pow(attempt - 2).toLong(), maxDelay.toMillis())
299299
}
300300
}
301301
}

0 commit comments

Comments
 (0)