Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
Remove unused field
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Jul 3, 2017
1 parent 5dbad87 commit 16c7d12
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions arrgh.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import (

// Session holds OpenCPU session connection information.
type Session struct {
cmd *exec.Cmd
host *url.URL
control io.Writer
root string
cmd *exec.Cmd
host *url.URL
root string
}

// NewLocalSession starts an R instance using the executable in the given
Expand Down Expand Up @@ -64,7 +63,7 @@ func NewLocalSession(path, root string, port int, timeout time.Duration) (*Sessi
}
sess.host.Path = pth.Join(sess.host.Path, root)
sess.root = pth.Join("/", root)
sess.control, err = sess.cmd.StdinPipe()
control, err := sess.cmd.StdinPipe()
if err != nil {
panic(err)
}
Expand All @@ -84,7 +83,7 @@ if (parse_version(as.character(packageVersion("opencpu"))) < "2.0.0") {
ocpu_start_server(port=%[1]d)
}
`
fmt.Fprintf(sess.control, startServer, port)
fmt.Fprintf(control, startServer, port)

runtime.SetFinalizer(&sess, func(s *Session) { s.Close() })

Expand Down Expand Up @@ -112,7 +111,6 @@ func (s *Session) Close() error {
return nil
}
s.host = nil
s.control = nil
return s.cmd.Process.Kill()
}

Expand Down

0 comments on commit 16c7d12

Please sign in to comment.