mirror of
https://github.com/datarhei/core.git
synced 2025-09-27 04:16:25 +08:00
Disable reconnect on SIGABRT (6)
This commit is contained in:
@@ -1002,6 +1002,7 @@ func (p *process) reader() {
|
|||||||
func (p *process) waiter() {
|
func (p *process) waiter() {
|
||||||
// The process exited normally, i.e. the return code is zero and no signal has been raised
|
// The process exited normally, i.e. the return code is zero and no signal has been raised
|
||||||
state := stateFinished
|
state := stateFinished
|
||||||
|
enableReconnect := true
|
||||||
|
|
||||||
if err := p.cmd.Wait(); err != nil {
|
if err := p.cmd.Wait(); err != nil {
|
||||||
// The process exited abnormally, i.e. the return code is non-zero or a signal
|
// The process exited abnormally, i.e. the return code is non-zero or a signal
|
||||||
@@ -1019,6 +1020,10 @@ func (p *process) waiter() {
|
|||||||
"signal": status.Signal().String(),
|
"signal": status.Signal().String(),
|
||||||
}).Debug().Log("Exited")
|
}).Debug().Log("Exited")
|
||||||
|
|
||||||
|
if int(status.Signal()) == 6 { // If ffmpeg has been killed with SIGABRT, it will disable a reconnect.
|
||||||
|
enableReconnect = false
|
||||||
|
}
|
||||||
|
|
||||||
if status.Exited() {
|
if status.Exited() {
|
||||||
if status.ExitStatus() == 255 {
|
if status.ExitStatus() == 255 {
|
||||||
// If ffmpeg has been killed with a SIGINT, SIGTERM, etc., then it exited normally,
|
// If ffmpeg has been killed with a SIGINT, SIGTERM, etc., then it exited normally,
|
||||||
@@ -1096,7 +1101,7 @@ func (p *process) waiter() {
|
|||||||
}).Debug().Log("Waiting")
|
}).Debug().Log("Waiting")
|
||||||
|
|
||||||
// Restart the process
|
// Restart the process
|
||||||
if p.getOrder() == "start" {
|
if p.getOrder() == "start" && enableReconnect {
|
||||||
p.reconnect(p.delay(state))
|
p.reconnect(p.delay(state))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user