mirror of
https://github.com/InsanusMokrassar/SauceNaoAPI.git
synced 2026-10-29 07:13:01 +00:00
update publishing
This commit is contained in:
1 parent
f27c493771
commit
f55744a038
3 files changed
+2
-20
No files matched your search
@@ -1,18 +0,0 @@
|
||||
package dev.inmo.saucenaoapi.utils
|
||||
|
||||
import dev.inmo.saucenaoapi.additional.LONG_TIME_RECALCULATING_MILLIS
|
||||
import dev.inmo.saucenaoapi.additional.SHORT_TIME_RECALCULATING_MILLIS
|
||||
import dev.inmo.saucenaoapi.models.Header
|
||||
import com.soywiz.klock.DateTime
|
||||
|
||||
internal suspend fun calculateSleepTime(
|
||||
header: Header,
|
||||
mostOldestInShortPeriodGetter: suspend () -> DateTime?,
|
||||
mostOldestInLongPeriodGetter: suspend () -> DateTime?
|
||||
): DateTime? {
|
||||
return when {
|
||||
header.longRemaining < 1 -> mostOldestInLongPeriodGetter() ?.plus(LONG_TIME_RECALCULATING_MILLIS)
|
||||
header.shortRemaining < 1 -> mostOldestInShortPeriodGetter() ?.plus(SHORT_TIME_RECALCULATING_MILLIS)
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user