Skip to content

Commit

Permalink
retry on timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
red-avtovo committed Oct 30, 2023
1 parent 35aace2 commit e451a58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const val GROUP_ID = "com.j0rsa.labot"
const val VERSION = "0.0.21"
const val VERSION = "0.0.22"
const val DOCKER_REGISTRY = "ghcr.io/j0rsa"
const val MAIN_CLASS = "com.j0rsa.labot.Main"
2 changes: 2 additions & 0 deletions src/com/j0rsa/labot/client/Anki.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Anki(
delayMillis { retry ->
retry * 3000L
}
retryOnException(maxRetries, true)
}
install(ContentNegotiation) {
val json = Json {
Expand Down Expand Up @@ -65,6 +66,7 @@ class Anki(
suspend fun addNote(note: Note) = sendAction("addNote", note)

suspend fun addNotes(notes: Collection<Note>) = run {
// TODO: validate that the deck exists as it won't trigger an error
log.info("adding notes")
val chunks = notes.chunked(10)
val size = chunks.size
Expand Down

0 comments on commit e451a58

Please sign in to comment.