Stop head during startup if getting an error (#401)

This commit is contained in:
KirillPamPam
2024-01-22 12:47:24 +04:00
committed by GitHub
parent 13323d0428
commit e798b1b8c2
2 changed files with 3 additions and 2 deletions

View File

@@ -445,7 +445,7 @@ abstract class Multistream(
private fun onUpstreamChange(event: UpstreamChangeEvent) {
val chain = event.chain
if (this.chain == chain) {
log.debug("Processing event {}", event)
log.trace("Processing event {}", event)
when (event.type) {
UpstreamChangeEvent.ChangeType.REVALIDATED -> {}
UpstreamChangeEvent.ChangeType.UPDATED -> {

View File

@@ -107,12 +107,13 @@ open class GenericUpstream(
val validSettingsResult = validator.validateUpstreamSettingsOnStartup()
when (validSettingsResult) {
ValidateUpstreamSettingsResult.UPSTREAM_FATAL_SETTINGS_ERROR -> {
connector.stop()
log.warn("Upstream ${getId()} couldn't start, invalid upstream settings")
connector.stop()
return
}
ValidateUpstreamSettingsResult.UPSTREAM_SETTINGS_ERROR -> {
log.warn("Non fatal upstream settings error, continue validation...")
connector.getHead().stop()
}
ValidateUpstreamSettingsResult.UPSTREAM_VALID -> {
isUpstreamValid.set(true)