修改:lyric查询视图库新能优化

This commit is contained in:
2026-02-04 17:57:45 +08:00
parent a50cc19463
commit 1343667b8a
2 changed files with 16 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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,