Skip to content

Commit

Permalink
Merge pull request #2275 from hongwei1/develop
Browse files Browse the repository at this point in the history
refactor/tweaked the default max connections
  • Loading branch information
simonredfern committed Sep 19, 2023
2 parents 86ed812 + a41c0f1 commit cb4d540
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ trait CustomProtoDBVendor extends ConnectionManager {

/**
* Override this method if you want something other than
* 4 connections in the pool
* 20 connections in the pool
*/
protected def maxPoolSize = 4
protected def maxPoolSize = 20

/**
* The absolute maximum that this pool can extend to
* The default is 20. Override this method to change.
* The default is 40. Override this method to change.
*/
protected def doNotExpandBeyond = 20
protected def doNotExpandBeyond = 30

/**
* The logic for whether we can expand the pool beyond the current size. By
Expand Down Expand Up @@ -96,8 +96,8 @@ trait CustomProtoDBVendor extends ConnectionManager {
logger.debug("Temporarily expanding pool. name=%s, tempMaxSize=%d".format(name, tempMaxSize))
newConnection(name)
}else{
logger.debug(s"The poolSize is expanding to tempMaxSize ($tempMaxSize), we can not create new connection, need to restart OBP now.")
throw new RuntimeException(s"Database may be down, please check database connection! OBP already create $tempMaxSize connections, because all connections are occupied!")
logger.error(s"The poolSize is expanding to tempMaxSize ($tempMaxSize), we can not create new connection, need to restart OBP now.")
Failure(s"Database may be down, please check database connection! OBP already create $tempMaxSize connections, because all connections are occupied!")
}

case x :: xs =>
Expand Down

0 comments on commit cb4d540

Please sign in to comment.