Skip to content

Commit

Permalink
Fix code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse committed Aug 7, 2024
1 parent a8a63ec commit 2acba72
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ func InvokeWatcher(log *logger.Logger) error {
return nil
}

versionedHome := paths.VersionedHome(paths.Top())
cmd := invokeCmd(versionedHome)
cmd := invokeCmd()
defer func() {
if cmd.Process != nil {
log.Debugf("releasing watcher %v", cmd.Process.Pid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (p *noopPidProvider) Name() string { return "noop" }

func (p *noopPidProvider) PID(ctx context.Context) (int, error) { return 0, nil }

func invokeCmd(topPath string) *exec.Cmd {
func invokeCmd() *exec.Cmd {
cmd := exec.Command(paths.TopBinaryPath(), watcherSubcommand,
"--path.config", paths.Config(),
"--path.home", paths.Top(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (p *pidProvider) PID(ctx context.Context) (int, error) {
return int(status.ProcessId), nil
}

func invokeCmd(topPath string) *exec.Cmd {
func invokeCmd() *exec.Cmd {
cmd := exec.Command(paths.TopBinaryPath(), watcherSubcommand,
"--path.config", paths.Config(),
"--path.home", paths.Top(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (u *Upgrader) Upgrade(ctx context.Context, a Action, reexecNow bool, skipVe
return nil, err
}

// InvokeWatcher invokes the watcher using the symlink that is rotated above with ChangeSymlink
if err := InvokeWatcher(u.log); err != nil {
rollbackInstall(ctx, newHash)
return nil, errors.New("failed to invoke rollback watcher", err)
Expand Down

0 comments on commit 2acba72

Please sign in to comment.