Alerting: Minor refactor to historan app RegisterAppInstaller. (#114828)
Splits the function in two so that NewAppInstaller can be used stanalone.
This commit is contained in:
@@ -26,7 +26,6 @@ func RegisterAppInstaller(
|
||||
cfg *setting.Cfg,
|
||||
ng *ngalert.AlertNG,
|
||||
) (*AlertingHistorianAppInstaller, error) {
|
||||
installer := &AlertingHistorianAppInstaller{}
|
||||
appSpecificConfig := historianAppConfig.RuntimeConfig{}
|
||||
|
||||
// If we're provided an AlertNG, then call back into that for things we need.
|
||||
@@ -43,6 +42,12 @@ func RegisterAppInstaller(
|
||||
appSpecificConfig.GetAlertStateHistoryHandler = handlers.GetAlertStateHistoryHandler
|
||||
}
|
||||
|
||||
return NewAppInstaller(appSpecificConfig)
|
||||
}
|
||||
|
||||
func NewAppInstaller(appSpecificConfig historianAppConfig.RuntimeConfig) (*AlertingHistorianAppInstaller, error) {
|
||||
installer := &AlertingHistorianAppInstaller{}
|
||||
|
||||
provider := simple.NewAppProvider(apis.LocalManifest(), appSpecificConfig, historianApp.New)
|
||||
|
||||
appConfig := app.Config{
|
||||
|
||||
Reference in New Issue
Block a user