Commit 782248a1 authored by Liang Ding's avatar Liang Ding

🎨 #12943

parent 36492fbd
......@@ -180,6 +180,34 @@ public final class Server extends BaseServer {
Markdowns.LUTE_AVAILABLE = true;
}
if (Latkes.isDocker()) {
// Docker 环境需要填充默认值
final String jdbcMinConns = System.getenv("JDBC_MIN_CONNS");
if (StringUtils.isBlank(jdbcMinConns)) {
Latkes.setLocalProperty("jdbc.minConnCnt", "5");
LOGGER.log(Level.INFO, "Default JDBC min conns");
} else {
LOGGER.log(Level.INFO, "env [JDBC_MIN_CONNS=" + jdbcMinConns + "]");
}
final String jdbcMaxConns = System.getenv("JDBC_MAX_CONNS");
if (StringUtils.isBlank(jdbcMaxConns)) {
Latkes.setLocalProperty("jdbc.maxConnCnt", "10");
LOGGER.log(Level.INFO, "Default JDBC max conns");
} else {
LOGGER.log(Level.INFO, "env [JDBC_MAX_CONNS=" + jdbcMaxConns + "]");
}
final String jdbcTablePrefix = System.getenv("JDBC_TABLE_PREFIX");
if (StringUtils.isBlank(jdbcTablePrefix)) {
Latkes.setLocalProperty("jdbc.tablePrefix", "b3_solo");
LOGGER.log(Level.INFO, "Default JDBC table prefix ");
} else {
LOGGER.log(Level.INFO, "env [JDBC_TABLE_PREFIX=" + jdbcTablePrefix + "]");
}
}
Dispatcher.startRequestHandler = new BeforeRequestHandler();
Dispatcher.HANDLERS.add(1, new SkinHandler());
Dispatcher.HANDLERS.add(2, new InitCheckHandler());
......
......@@ -18,7 +18,7 @@
#
# Description: Solo local environment configurations for docker.
# Version: 2.0.0.0, Mar 19, 2019
# Version: 2.0.0.1, Nov 11, 2019
# Author: Liang Ding
#
......@@ -29,8 +29,8 @@ jdbc.driver=${JDBC_DRIVER}
jdbc.URL=${JDBC_URL}
# The minConnCnt MUST larger or equal to 3
jdbc.minConnCnt=5
jdbc.maxConnCnt=10
jdbc.minConnCnt=${JDBC_MIN_CONNS}
jdbc.maxConnCnt=${JDBC_MAX_CONNS}
# The specific table name prefix
jdbc.tablePrefix=b3_solo
jdbc.tablePrefix=${JDBC_TABLE_PREFIX}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment