Skip to content

Commit

Permalink
labagent/supervisor: does this fix it?
Browse files Browse the repository at this point in the history
  • Loading branch information
postables committed May 6, 2020
1 parent e8acbf7 commit 44530a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion labagent/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ func New(root, appRoot, appAddr string, client *httputil.Client, fs *downloaders
}

func (s *supervisor) Supervise(ctx context.Context, id, link string, pdef metadata.PeerDefinition) error {
zerolog.Ctx(ctx).Info().Msg("starting supervise process")
err := s.kill(ctx)
if err != nil {
zerolog.Ctx(ctx).Error().Err(err).Msg("failed to kill processes")
return err
}

Expand Down Expand Up @@ -125,6 +127,7 @@ func (s *supervisor) peerDefinitionToFlags(id string, pdef metadata.PeerDefiniti
}

func (s *supervisor) start(ctx context.Context, flags []string) error {
zerolog.Ctx(ctx).Info().Msg("entered start")
var actx context.Context
actx, s.cancel = context.WithCancel(context.Background())
s.app = s.cmd(actx, flags...)
Expand All @@ -134,7 +137,7 @@ func (s *supervisor) start(ctx context.Context, flags []string) error {
}

v := new(bytes.Buffer)
versionCmd := s.cmdWithStdio(ctx, v, ioutil.Discard, "--version")
versionCmd := s.cmdWithStdio(actx, v, ioutil.Discard, "--version")
err = versionCmd.Run()
if err != nil {
return err
Expand Down

0 comments on commit 44530a5

Please sign in to comment.