fix: regression from refactor in AMQP notification (#14455)

fixes a regression introduced in #14269 that refactored
the notification registration logic, all the amqp targets
however online will not be available for use anymore.

fixes #14451
This commit is contained in:
Harshavardhana 2022-03-02 21:35:48 -08:00 committed by GitHub
parent 7e803adf13
commit f6875bb893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,6 +138,12 @@ func fetchSubSysTargets(ctx context.Context, cfg config.Config,
}
_ = newTarget.Close()
}
if err = targetList.Add(newTarget); err != nil {
logger.LogIf(context.Background(), err)
if returnOnTargetError {
return targetsOffline, err
}
}
}
case config.NotifyESSubSys:
esTargets, err := GetNotifyES(cfg[config.NotifyESSubSys], transport)