From 4e6960fab57522afb7e07189bb706fbd3afa45f4 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 27 Aug 2024 16:03:55 +0100 Subject: [PATCH] Updated withRetries for MySQL --- .../spigot/data/handlers/impl/MySQLPersistentDataHandler.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/handlers/impl/MySQLPersistentDataHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/handlers/impl/MySQLPersistentDataHandler.kt index b1bdda04..cdcaca02 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/handlers/impl/MySQLPersistentDataHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/handlers/impl/MySQLPersistentDataHandler.kt @@ -246,14 +246,14 @@ class MySQLPersistentDataHandler( } } - private inline fun withRetries(action: () -> T): T { + private inline fun withRetries(action: () -> T): T? { var retries = 1 while (true) { try { return action() } catch (e: Exception) { if (retries > 5) { - throw e + return null } retries++