From 8e0f7144a4f423461f962ba29da4b1768356a32e Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 3 Sep 2024 02:09:37 +0200 Subject: [PATCH] Bump version --- build.gradle.kts | 2 +- .../lavakord/audio/retry/LinearRetry.kt | 1 + core/src/commonTest/kotlin/RetryTest.kt | 6 ++-- plugins/lavasearch/build.gradle.kts | 30 +++++++++---------- plugins/lavasrc/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 6 files changed, 23 insertions(+), 20 deletions(-) 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",