diff --git a/simplenotes-domain/src/main/kotlin/be/simplenotes/domain/usecases/HealthCheckService.kt b/simplenotes-domain/src/main/kotlin/be/simplenotes/domain/usecases/HealthCheckService.kt index f23ac91..f74b9e8 100644 --- a/simplenotes-domain/src/main/kotlin/be/simplenotes/domain/usecases/HealthCheckService.kt +++ b/simplenotes-domain/src/main/kotlin/be/simplenotes/domain/usecases/HealthCheckService.kt @@ -8,6 +8,6 @@ interface HealthCheckService { } @Singleton -class HealthCheckServiceImpl(private val dbHealthCheck: DbHealthCheck): HealthCheckService { +class HealthCheckServiceImpl(private val dbHealthCheck: DbHealthCheck) : HealthCheckService { override fun isOk() = dbHealthCheck.isOk() } diff --git a/simplenotes-persistance/src/main/kotlin/be/simplenotes/persistance/HealthCheck.kt b/simplenotes-persistance/src/main/kotlin/be/simplenotes/persistance/HealthCheck.kt index 9f9162c..6c106a6 100644 --- a/simplenotes-persistance/src/main/kotlin/be/simplenotes/persistance/HealthCheck.kt +++ b/simplenotes-persistance/src/main/kotlin/be/simplenotes/persistance/HealthCheck.kt @@ -6,8 +6,7 @@ import be.simplenotes.persistance.utils.type import me.liuwj.ktorm.database.Database import me.liuwj.ktorm.database.asIterable import me.liuwj.ktorm.database.use -import java.io.EOFException -import java.sql.SQLTransientException +import java.sql.SQLException import javax.inject.Singleton interface DbHealthCheck { @@ -26,9 +25,7 @@ internal class DbHealthCheckImpl( it.executeQuery().asIterable().map { it.getString(1) } } }.any { it in dataSourceConfig.jdbcUrl } - } catch (e: SQLTransientException) { - false - } catch (e: EOFException) { + } catch (e: SQLException) { false } }