|
@@ -1,5 +1,6 @@
|
|
|
package tech.powerjob.work.config;
|
|
|
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
|
import tech.powerjob.common.utils.CommonUtils;
|
|
|
import com.zaxxer.hikari.HikariConfig;
|
|
@@ -21,12 +22,14 @@ import javax.sql.DataSource;
|
|
|
*/
|
|
|
@Configuration
|
|
|
@ConditionalOnBean(PowerJobWorker.class)
|
|
|
+@Log4j2
|
|
|
public class SqlProcessorConfiguration {
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
@DependsOn({"initPowerJob"})
|
|
|
public DataSource sqlProcessorDataSource() {
|
|
|
+ log.info("开始初始化powerJob了");
|
|
|
String path = System.getProperty("user.home") + "/test/h2/" + CommonUtils.genUUID() + "/";
|
|
|
String jdbcUrl = String.format("jdbc:h2:file:%spowerjob_sql_processor_db;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false", path);
|
|
|
HikariConfig config = new HikariConfig();
|
|
@@ -37,6 +40,8 @@ public class SqlProcessorConfiguration {
|
|
|
config.setMinimumIdle(1);
|
|
|
// 池中最大连接数量
|
|
|
config.setMaximumPoolSize(10);
|
|
|
+ log.info("初始化powerJob完毕");
|
|
|
+ log.info("config:{}"+config);
|
|
|
return new HikariDataSource(config);
|
|
|
}
|
|
|
|