From 7bc7bf6e8cf02bf1fa00cddd6c94d22fdfc440e7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 18 Mar 2023 12:35:18 +0600 Subject: [PATCH] update dependencies --- CHANGELOG.md | 4 +++- gradle/libs.versions.toml | 10 +++++----- ratings/gc/src/jvmMain/kotlin/Plugin.kt | 6 ++---- .../selector_with_timer/src/jvmMain/kotlin/Plugin.kt | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c423f9..9e9a2c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ ## 0.1.1 +* Update dependencies + ## 0.0.10 ## 0.0.9 -* Update depedencies +* Update dependencies diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9d06886..fb67715 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,13 +3,13 @@ kotlin = "1.8.10" kotlin-serialization = "1.5.0" -plagubot = "5.0.0" -tgbotapi = "7.0.0" +plagubot = "5.0.1" +tgbotapi = "7.0.1" microutils = "0.17.5" kslog = "1.0.0" -krontab = "0.9.0" -tgbotapi-libraries = "0.10.0" -plagubot-plugins = "0.10.0" +krontab = "0.10.0-branch_0.10.0-build171" +tgbotapi-libraries = "0.10.1" +plagubot-plugins = "0.10.1" dokka = "1.8.10" diff --git a/ratings/gc/src/jvmMain/kotlin/Plugin.kt b/ratings/gc/src/jvmMain/kotlin/Plugin.kt index 1f06e5f..d8a297a 100644 --- a/ratings/gc/src/jvmMain/kotlin/Plugin.kt +++ b/ratings/gc/src/jvmMain/kotlin/Plugin.kt @@ -1,10 +1,9 @@ package dev.inmo.plaguposter.ratings.gc -import com.soywiz.klock.milliseconds import com.soywiz.klock.seconds import dev.inmo.krontab.KrontabTemplate import dev.inmo.krontab.toSchedule -import dev.inmo.krontab.utils.asFlow +import dev.inmo.krontab.utils.asFlowWithDelays import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions import dev.inmo.micro_utils.repos.* import dev.inmo.plagubot.Plugin @@ -12,7 +11,6 @@ import dev.inmo.plaguposter.posts.repo.PostsRepo import dev.inmo.plaguposter.ratings.models.Rating import dev.inmo.plaguposter.ratings.repo.RatingsRepo import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.types.MilliSeconds import dev.inmo.tgbotapi.types.Seconds import kotlinx.serialization.Serializable import kotlinx.serialization.json.* @@ -50,7 +48,7 @@ object Plugin : Plugin { } } config.autoclear ?.let { autoclear -> - autoclear.autoClearKrontab.toSchedule().asFlow().subscribeSafelyWithoutExceptions(scope) { + autoclear.autoClearKrontab.toSchedule().asFlowWithDelays().subscribeSafelyWithoutExceptions(scope) { val dropCreatedBefore = it - (autoclear.skipPostAge ?: 0).seconds ratingsRepo.getPostsWithRatingLessEq(autoclear.rating).keys.forEach { if ((postsRepo.getPostCreationTime(it) ?: return@forEach) < dropCreatedBefore) { diff --git a/triggers/selector_with_timer/src/jvmMain/kotlin/Plugin.kt b/triggers/selector_with_timer/src/jvmMain/kotlin/Plugin.kt index 33f324c..9fb94fe 100644 --- a/triggers/selector_with_timer/src/jvmMain/kotlin/Plugin.kt +++ b/triggers/selector_with_timer/src/jvmMain/kotlin/Plugin.kt @@ -2,7 +2,7 @@ package dev.inmo.plaguposter.triggers.selector_with_timer import dev.inmo.krontab.KrontabTemplate import dev.inmo.krontab.toSchedule -import dev.inmo.krontab.utils.asFlow +import dev.inmo.krontab.utils.asFlowWithDelays import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions import dev.inmo.plagubot.Plugin import dev.inmo.plaguposter.posts.sending.PostPublisher @@ -35,7 +35,7 @@ object Plugin : Plugin { val publisher = koin.get() val selector = koin.get() val filters = koin.getAll().distinct() - koin.get().krontab.asFlow().subscribeSafelyWithoutExceptions(this) { dateTime -> + koin.get().krontab.asFlowWithDelays().subscribeSafelyWithoutExceptions(this) { dateTime -> selector.take(now = dateTime).forEach { postId -> if (filters.all { it.check(postId, dateTime) }) { publisher.publish(postId)