From 505108d2dd33d3ae8b792fe5e091b43708065941 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 3 Nov 2024 17:40:12 +0600 Subject: [PATCH 1/3] start 2.6.0 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54d6185..c4f8f1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 2.6.0 + ## 2.5.1 * Add cleaning up of incoming template, which must remove all malformed parts from string template (fix of [#126](https://github.com/InsanusMokrassar/krontab/issues/126)) diff --git a/gradle.properties b/gradle.properties index f9510e3..2e6ae2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,5 +36,5 @@ androidx_work_version=2.10.0 ## Common -version=2.5.1 -android_code_version=43 +version=2.6.0 +android_code_version=44 From 17971ed8fb3991763179b5f955ae8e22437b71b8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 3 Nov 2024 17:40:42 +0600 Subject: [PATCH 2/3] now doOnceTz works as it must --- CHANGELOG.md | 2 ++ src/commonMain/kotlin/Executes.kt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f8f1f..fe95f62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +* Fix of `doOnceTz` behaviour: now it will use local time as utc time to get next waking up time + ## 2.6.0 ## 2.5.1 diff --git a/src/commonMain/kotlin/Executes.kt b/src/commonMain/kotlin/Executes.kt index 90a31ba..751222d 100644 --- a/src/commonMain/kotlin/Executes.kt +++ b/src/commonMain/kotlin/Executes.kt @@ -35,6 +35,8 @@ suspend inline fun KronScheduler.doOnceLocal(block: (DateTime) -> T): T = do /** * Execute [block] once at the [KronScheduler.next] time and return result of [block] calculation. * + * WARNING!!! This method will use local time instead of utc + * * WARNING!!! If you want to launch it in parallel, you must do this explicitly. * * WARNING!!! In case if [KronScheduler.next] of [this] instance will return null, [block] will be called immediatelly @@ -42,7 +44,7 @@ suspend inline fun KronScheduler.doOnceLocal(block: (DateTime) -> T): T = do suspend inline fun KronScheduler.doOnceTz(noinline block: suspend (DateTimeTz) -> T): T { val time = when (this) { is KronSchedulerTz -> nextOrNowWithOffset() - else -> nextOrNow().local + else -> nextTimeZoned() ?: DateTimeTz.nowLocal() } delay((time - DateTimeTz.nowLocal()).millisecondsLong) return block(time) From b9237e13c91d42770308142ee25cad67a9c6135d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 3 Nov 2024 17:41:13 +0600 Subject: [PATCH 3/3] fix changelog :) --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe95f62..66aaf56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog -* Fix of `doOnceTz` behaviour: now it will use local time as utc time to get next waking up time - ## 2.6.0 +* Fix of `doOnceTz` behaviour: now it will use local time as utc time to get next waking up time + ## 2.5.1 * Add cleaning up of incoming template, which must remove all malformed parts from string template (fix of [#126](https://github.com/InsanusMokrassar/krontab/issues/126))