Skip to content

Commit

Permalink
prevent multiple crashes when reloading the configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Jan 25, 2024
1 parent cf7088a commit bfdff82
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.metrics.Initialize()
if err != nil {
p.metrics = nil

Check warning on line 290 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L290

Added line #L290 was not covered by tests
return err
}
}
Expand All @@ -300,6 +301,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.pprof.Initialize()
if err != nil {
p.pprof = nil

Check warning on line 304 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L304

Added line #L304 was not covered by tests
return err
}
}
Expand All @@ -324,6 +326,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.playbackServer.Initialize()
if err != nil {
p.playbackServer = nil

Check warning on line 329 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L329

Added line #L329 was not covered by tests
return err
}
}
Expand Down Expand Up @@ -383,6 +386,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.rtspServer.Initialize()
if err != nil {
p.rtspServer = nil

Check warning on line 389 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L389

Added line #L389 was not covered by tests
return err
}

Expand Down Expand Up @@ -422,6 +426,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.rtspsServer.Initialize()
if err != nil {
p.rtspsServer = nil

Check warning on line 429 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L429

Added line #L429 was not covered by tests
return err
}

Expand Down Expand Up @@ -452,6 +457,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.rtmpServer.Initialize()
if err != nil {
p.rtmpServer = nil

Check warning on line 460 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L460

Added line #L460 was not covered by tests
return err
}

Expand Down Expand Up @@ -482,6 +488,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.rtmpsServer.Initialize()
if err != nil {
p.rtmpsServer = nil

Check warning on line 491 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L491

Added line #L491 was not covered by tests
return err
}

Expand Down Expand Up @@ -514,6 +521,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.hlsServer.Initialize()
if err != nil {
p.hlsServer = nil

Check warning on line 524 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L524

Added line #L524 was not covered by tests
return err
}

Expand Down Expand Up @@ -574,6 +582,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.srtServer.Initialize()
if err != nil {
p.srtServer = nil

Check warning on line 585 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L585

Added line #L585 was not covered by tests
return err
}

Expand All @@ -600,6 +609,7 @@ func (p *Core) createResources(initial bool) error {
}
err := p.api.Initialize()
if err != nil {
p.api = nil

Check warning on line 612 in internal/core/core.go

View check run for this annotation

Codecov / codecov/patch

internal/core/core.go#L612

Added line #L612 was not covered by tests
return err
}
}
Expand Down

0 comments on commit bfdff82

Please sign in to comment.