Updated withRetries for MySQL

This commit is contained in:
Auxilor
2024-08-27 16:03:55 +01:00
parent c95c1f032d
commit 4e6960fab5

View File

@@ -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 var retries = 1
while (true) { while (true) {
try { try {
return action() return action()
} catch (e: Exception) { } catch (e: Exception) {
if (retries > 5) { if (retries > 5) {
throw e return null
} }
retries++ retries++