mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Added message for debugging
Added process state message to be returned to wait channel to help resolve the reason for the "app died" message
This commit is contained in:
@@ -69,11 +69,11 @@ func (cmd AppCmd) Start(c *model.CommandConfig) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-cmd.waitChan():
|
case exitState := <-cmd.waitChan():
|
||||||
return errors.New("revel/harness: app died")
|
return errors.New("revel/harness: app died reason: " + exitState)
|
||||||
|
|
||||||
case <-time.After(30 * time.Second):
|
case <-time.After(60 * time.Second):
|
||||||
log.Println("Killing revel server process did not respond after wait timeout", "processid", cmd.Process.Pid)
|
log.Println("Killing revel server process did not respond after wait timeout.", "processid", cmd.Process.Pid)
|
||||||
cmd.Kill()
|
cmd.Kill()
|
||||||
return errors.New("revel/harness: app timed out")
|
return errors.New("revel/harness: app timed out")
|
||||||
|
|
||||||
@@ -105,11 +105,17 @@ func (cmd AppCmd) Kill() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return a channel that is notified when Wait() returns.
|
// Return a channel that is notified when Wait() returns.
|
||||||
func (cmd AppCmd) waitChan() <-chan struct{} {
|
func (cmd AppCmd) waitChan() <-chan string {
|
||||||
ch := make(chan struct{}, 1)
|
ch := make(chan string, 1)
|
||||||
go func() {
|
go func() {
|
||||||
_ = cmd.Wait()
|
_ = cmd.Wait()
|
||||||
ch <- struct{}{}
|
state := cmd.ProcessState
|
||||||
|
exitStatus := " unknown "
|
||||||
|
if state!=nil {
|
||||||
|
exitStatus = state.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
ch <- exitStatus
|
||||||
}()
|
}()
|
||||||
return ch
|
return ch
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (app *App, compi
|
|||||||
|
|
||||||
// If the build succeeded, we're done.
|
// If the build succeeded, we're done.
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
utils.Logger.Info("Build successful continuing")
|
||||||
return NewApp(binName, paths), nil
|
return NewApp(binName, paths), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user