fix(alerting): ClickHouseSearchIndex bean registered as concrete type (hotfix: production crashloop) #141
@@ -123,9 +123,14 @@ public class StorageBeanConfig {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SearchIndex clickHouseSearchIndex(
|
||||
public ClickHouseSearchIndex clickHouseSearchIndex(
|
||||
TenantProperties tenantProperties,
|
||||
@Qualifier("clickHouseJdbcTemplate") JdbcTemplate clickHouseJdbc) {
|
||||
// Return type is the concrete class so Spring exposes the bean under both
|
||||
// SearchIndex (for SearchIndexer) AND ClickHouseSearchIndex (for ExchangeMatchEvaluator,
|
||||
// which calls countExecutionsForAlerting — a method that exists only on the concrete type).
|
||||
// Declaring the return as the interface hides the concrete methods from autowire
|
||||
// matching and crashloops the app on startup.
|
||||
return new ClickHouseSearchIndex(tenantProperties.getId(), clickHouseJdbc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user