Skip to content

Commit d6b7580

Browse files
committed
Update some Kdoc
1 parent 56588c9 commit d6b7580

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

scripts/create-new-release-notes.main.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ File("release-notes.txt").writeText(text)
5555
// TODO: Duplicate; use the retry.main.kts script.
5656
// See other scripts for example usage.
5757
// NOTE that currently, IntelliJ code features break when importing external scripts.
58+
/**
59+
* Try [forAtMost] times to run the block without exception.
60+
*
61+
* We could also make subsequent runs wait
62+
* for an [exponential delay](https://en.wikipedia.org/wiki/Exponential_backoff).
63+
* See [this article](https://dzone.com/articles/understanding-retry-pattern-with-exponential-back).
64+
*
65+
* I wrote this function myself.
66+
* It is interesting that [this solution](https://stackoverflow.com/a/46890009)
67+
* proposed by Roman Elizarov is very similar to mine.
68+
*/
5869
fun <T> tryTo(
5970
description: String,
6071
forAtMost: Int = 5,

scripts/retry.main.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import kotlin.time.toDuration
1212
val waitTime = 10.toDuration(DurationUnit.SECONDS)
1313

1414
/**
15-
* Try for at most [retryCount] times to run the block without exception.
15+
* Try [forAtMost] times to run the block without exception.
1616
*
1717
* We could also make subsequent runs wait
1818
* for an [exponential delay](https://en.wikipedia.org/wiki/Exponential_backoff).

0 commit comments

Comments
 (0)