rename server Run to Start to better reflect functionality

This commit is contained in:
Matthew Jaffee 2018-04-23 16:28:24 -05:00
parent 9deefbaefc
commit f99479932d
No known key found for this signature in database
GPG key ID: 51C676AF9FFCDB87
3 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ It will load existing data from the configured
directory and start listening for client connections
on the configured port.`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := Server.Run(); err != nil {
if err := Server.Start(); err != nil {
return errors.Wrap(err, "running server")
}
return errors.Wrap(Server.Wait(), "waiting on Server")

View file

@ -90,8 +90,8 @@ func NewCommand(stdin io.Reader, stdout, stderr io.Writer) *Command {
}
}
// Run executes the pilosa server.
func (m *Command) Run(args ...string) (err error) { // TODO args WTF
// Start starts the pilosa server - it returns once the server is running.
func (m *Command) Start() (err error) {
defer close(m.Started)
prefix := "~" + string(filepath.Separator)
if strings.HasPrefix(m.Config.DataDir, prefix) {

View file

@ -116,7 +116,7 @@ func runMainWithCluster(size int) ([]*Main, error) {
func MustRunMain() *Main {
m := NewMain()
m.Config.Metric.Diagnostics = false // Disable diagnostics.
if err := m.Run(); err != nil {
if err := m.Start(); err != nil {
panic(err)
}
return m
@ -147,7 +147,7 @@ func (m *Main) Reopen() error {
m.Server.Holder.NewAttrStore = m.Server.NewAttrStore
// Run new program.
if err := m.Run(); err != nil {
if err := m.Start(); err != nil {
return err
}
return nil