修改:lyric查询视图库新能优化
This commit is contained in:
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Configuration
|
||||
@PropertySource(
|
||||
value = "classpath:common-${spring.profiles.active:lyric}.yml",
|
||||
value = "classpath:common-${spring.profiles.active:}.yml",
|
||||
factory = CommonConfig.YamlPropertySourceFactory.class
|
||||
)
|
||||
public class CommonConfig {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DataSourcePreWarmer {
|
||||
@Qualifier("secondDataSource") DataSource secondDataSource) {
|
||||
return args -> {
|
||||
try (Connection conn = secondDataSource.getConnection()) {
|
||||
log.info("✅ secondDataSource 预热成功,连接已建立: {}", conn);
|
||||
log.info("✅ secondDataSource 预热成功,连接已建立: {}", conn.getMetaData().getURL());
|
||||
} catch (Exception e) {
|
||||
log.error("❌ secondDataSource 预热失败", e);
|
||||
throw new RuntimeException(e);
|
||||
@@ -29,6 +29,20 @@ public class DataSourcePreWarmer {
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ApplicationRunner thirdDataSourcePreWarmer(
|
||||
@Qualifier("thirdDataSource") DataSource thirdDataSource) {
|
||||
return args -> {
|
||||
try (Connection conn = thirdDataSource.getConnection()) {
|
||||
log.info("✅ thirdDataSource 预热成功,连接已建立: {}", conn.getMetaData().getURL());
|
||||
} catch (Exception e) {
|
||||
log.error("❌ thirdDataSource 预热失败", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// @Bean
|
||||
// public ApplicationRunner mainDataSourcePreWarmer(
|
||||
// @Qualifier("masterDataSource") DataSource master,
|
||||
|
||||
Reference in New Issue
Block a user