Skip to content

Commit

Permalink
Updated withRetries for MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Aug 27, 2024
1 parent c95c1f0 commit 4e6960f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ class MySQLPersistentDataHandler(
}
}

private inline fun <T> withRetries(action: () -> T): T {
private inline fun <T> withRetries(action: () -> T): T? {
var retries = 1
while (true) {
try {
return action()
} catch (e: Exception) {
if (retries > 5) {
throw e
return null
}
retries++

Expand Down

0 comments on commit 4e6960f

Please sign in to comment.