|
|
@@ -14,18 +14,18 @@ import java.util.Date;
|
|
|
@Component
|
|
|
@Slf4j
|
|
|
public class DataSourceTask {
|
|
|
- /**
|
|
|
- * 定时刷新动态数据源连接池
|
|
|
- */
|
|
|
- @Scheduled(cron = "0 */5 * * * ?")
|
|
|
- public void RefreshConnectionPool() {
|
|
|
- System.out.printf("定时刷新动态数据源连接池:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));
|
|
|
- DataSource datasource = DatasourceUtil.getDataSource(GlobalConstant.DEFAULT_DATASOURCE_KEY);
|
|
|
- try {
|
|
|
- Db use = Db.use(datasource);
|
|
|
- use.query("select 1");
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.getMessage(), "定时刷新动态数据源连接池");
|
|
|
- }
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 定时刷新动态数据源连接池
|
|
|
+// */
|
|
|
+// @Scheduled(cron = "0 */5 * * * ?")
|
|
|
+// public void RefreshConnectionPool() {
|
|
|
+// System.out.printf("定时刷新动态数据源连接池:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));
|
|
|
+// DataSource datasource = DatasourceUtil.getDataSource(GlobalConstant.DEFAULT_DATASOURCE_KEY);
|
|
|
+// try {
|
|
|
+// Db use = Db.use(datasource);
|
|
|
+// use.query("select 1");
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error(e.getMessage(), "定时刷新动态数据源连接池");
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|