Skip to content

Commit

Permalink
Pivotal ID # 186941052: Check Ftp Connections Before Borrow (#802)
Browse files Browse the repository at this point in the history
https://www.pivotaltracker.com/story/show/186941052

Enable test on borrow

---------

Co-authored-by: Jhoan Munoz <jhoanmanuelms@gmail.com>
  • Loading branch information
Juan-EBI and jhoanmanuelms authored Jan 30, 2024
1 parent 26c8a99 commit b5aaca4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ internal class FTPClientPool(
val ftpClient = p.`object`
return try {
ftpClient.sendNoOp()
} catch (e: Exception) {
logger.error(e) { "Error checking ftp connection" }
} catch (exception: Exception) {
logger.error { "Error checking ftp connection: ${ exception.localizedMessage }" }
false
}
}
Expand All @@ -91,6 +91,7 @@ internal class FTPClientPool(
val factory = FTPClientFactory(ftpUser, ftpPassword, ftpUrl, ftpPort, ftpRootPath)
var connections = GenericObjectPool(factory)
connections.minIdle = MIN_CONNECTION
connections.testOnBorrow = true
return connections
}
}
Expand Down

0 comments on commit b5aaca4

Please sign in to comment.