add retryOnPostFailureTimes

This commit is contained in:
2023-11-06 19:18:19 +06:00
parent 947bd7c2c4
commit 0cc0510876
5 changed files with 43 additions and 14 deletions

View File

@@ -5,4 +5,9 @@ import dev.inmo.plaguposter.posts.models.PostId
interface Selector {
suspend fun take(n: Int = 1, now: DateTime = DateTime.now(), exclude: List<PostId> = emptyList()): List<PostId>
suspend fun takeOneOrNull(now: DateTime = DateTime.now(), exclude: List<PostId> = emptyList()): PostId? = take(
n = 1,
now = now,
exclude = exclude
).firstOrNull()
}