Updated withRetries for MySQL
This commit is contained in:
@@ -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++
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user