private IHealthNotifier BuildHealthNotifier(HealthNotifierBuilderSettings builderSettings, ILogFactory logFactory) { return(new HealthNotifier(builderSettings.AppName, builderSettings.AppVersion, builderSettings.EnvInfo ?? "?", logFactory, _slackNotificationsSender)); }
public IHealthNotifier GetOrCreateHealthNotifier(string appName, string appVersion, string envInfo, ILogFactory logFactory) { var builderSettings = new HealthNotifierBuilderSettings(appName, appVersion, envInfo); return(_healthNotifiers.GetOrAdd(builderSettings, p => { return new Lazy <IHealthNotifier>(() => { _log.Info($"Registering health notifier: appName {p.AppName}, appVersion {p.AppVersion}, envInfo {p.EnvInfo}"); return BuildHealthNotifier(builderSettings, logFactory); }); }).Value); }