diff --git a/build.gradle.kts b/build.gradle.kts index ae4d6bc0..e1c28e68 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ plugins { } group = "dev.schlaubi.lavakord" -version = "6.3.1" +version = "6.4.0" allprojects { repositories { diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/retry/LinearRetry.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/retry/LinearRetry.kt index a720ebb8..57ea5a65 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/retry/LinearRetry.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/retry/LinearRetry.kt @@ -43,6 +43,7 @@ internal class LinearRetry( // tries/maxTries ratio * (backOffDiff) = retryProgress val ratio = tries.getAndIncrement() / (maxTries - 1).toDouble() + if (ratio.isNaN()) return val retryProgress = (maxBackoff - firstBackoff) * ratio val diff = firstBackoff + retryProgress diff --git a/core/src/commonTest/kotlin/RetryTest.kt b/core/src/commonTest/kotlin/RetryTest.kt index 52a76aea..efb6d824 100644 --- a/core/src/commonTest/kotlin/RetryTest.kt +++ b/core/src/commonTest/kotlin/RetryTest.kt @@ -14,9 +14,11 @@ class RetryTest { @JsName("testRetryMaxFail") @Test fun `check whether retry exits correctly after exceeding max`() { - val retry = LinearRetry(1.seconds, 5.seconds, 1) + val retry = LinearRetry(1.seconds, 5.seconds, 2) Tests.runBlocking { - retry.retry() + repeat(2) { + retry.retry() + } assertFalse(retry.hasNext, "Retry::hasNext has to be false when maxTries has been exceeded") assertFailsWith("Retry is supposed to throw illegalStateException when retrying after max was exceeded") { retry.retry() } diff --git a/plugins/lavasearch/build.gradle.kts b/plugins/lavasearch/build.gradle.kts index 3deace51..20061ba0 100644 --- a/plugins/lavasearch/build.gradle.kts +++ b/plugins/lavasearch/build.gradle.kts @@ -31,23 +31,23 @@ kotlin { } dependencies { - kspCommonMainMetadata(libs.kord.ksp.processors) +// kspCommonMainMetadata(libs.kord.ksp.processors) } -tasks { - listOf( - "sourcesJar", - "jsSourcesJar", - "jvmSourcesJar", - "compileKotlinJs", - "compileKotlinJvm", - "dokkaHtml" - ).forEach { - named(it) { - dependsOn("kspCommonMainKotlinMetadata") - } - } -} +//tasks { +// listOf( +// "sourcesJar", +// "jsSourcesJar", +// "jvmSourcesJar", +// "compileKotlinJs", +// "compileKotlinJvm", +// "dokkaHtml" +// ).forEach { +// named(it) { +// dependsOn("kspCommonMainKotlinMetadata") +// } +// } +//} mavenPublishing { configure(KotlinMultiplatform(JavadocJar.Dokka("dokkaHtml"))) diff --git a/plugins/lavasrc/build.gradle.kts b/plugins/lavasrc/build.gradle.kts index 4c8411a3..f6e6274a 100644 --- a/plugins/lavasrc/build.gradle.kts +++ b/plugins/lavasrc/build.gradle.kts @@ -25,7 +25,7 @@ kotlin { } dependencies { - kspCommonMainMetadata(projects.plugins.kspProcessor) +// kspCommonMainMetadata(projects.plugins.kspProcessor) } //tasks { diff --git a/settings.gradle.kts b/settings.gradle.kts index e6c11dd6..fd37d13f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,7 +6,7 @@ include( "kord", // GitHub Actions gets mad about this and I can't reproduce this locally "jsExample", "core", - ":plugins:kspProcessor", +// ":plugins:kspProcessor", ":plugins:sponsorblock", ":plugins:lavasrc", ":plugins:lavasearch",