mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 16:37:04 +08:00
Merge branch 'dev' into vod
This commit is contained in:
@@ -637,9 +637,6 @@ func (p *process) start() error {
|
|||||||
// Start the reader
|
// Start the reader
|
||||||
go p.reader()
|
go p.reader()
|
||||||
|
|
||||||
// Wait for the process to finish
|
|
||||||
go p.waiter()
|
|
||||||
|
|
||||||
// Start the stale timeout if enabled
|
// Start the stale timeout if enabled
|
||||||
if p.stale.timeout != 0 {
|
if p.stale.timeout != 0 {
|
||||||
var ctx context.Context
|
var ctx context.Context
|
||||||
@@ -872,17 +869,19 @@ func (p *process) reader() {
|
|||||||
p.stale.lock.Unlock()
|
p.stale.lock.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := scanner.Err(); err != nil {
|
||||||
|
p.logger.Debug().WithError(err).Log("")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for the process to finish
|
||||||
|
p.waiter()
|
||||||
}
|
}
|
||||||
|
|
||||||
// waiter waits for the process to finish. If enabled, the process will
|
// waiter waits for the process to finish. If enabled, the process will
|
||||||
// be scheduled for a restart.
|
// be scheduled for a restart.
|
||||||
func (p *process) waiter() {
|
func (p *process) waiter() {
|
||||||
if p.getState() == stateFinishing {
|
// The process exited normally, i.e. the return code is zero and no signal has been raised
|
||||||
p.stop(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// The process exited normally, i.e. the return code is zero and no signal
|
|
||||||
// has been raised
|
|
||||||
state := stateFinished
|
state := stateFinished
|
||||||
|
|
||||||
if err := p.cmd.Wait(); err != nil {
|
if err := p.cmd.Wait(); err != nil {
|
||||||
|
Reference in New Issue
Block a user