()
| 627 | func (o options) StatusFile() string { return o.OptStatusFile } |
| 628 | |
| 629 | func getGraceServerCommand() cli.Command { |
| 630 | return cli.Command{ |
| 631 | Name: "glace-server", |
| 632 | ShortName: "gsrv", |
| 633 | Usage: "Run API Server with graceful restart support", |
| 634 | Description: "Run Gohan API server with graceful restart support", |
| 635 | Flags: []cli.Flag{ |
| 636 | cli.StringFlag{Name: "config-file", Value: defaultConfigFile, Usage: "Server config File"}, |
| 637 | }, |
| 638 | Action: func(c *cli.Context) { |
| 639 | configFile := c.String("config-file") |
| 640 | loadConfig(configFile) |
| 641 | opts := &options{OptInterval: -1} |
| 642 | opts.OptCommand = os.Args[0] |
| 643 | config := util.GetConfig() |
| 644 | opts.OptPorts = []string{config.GetString("address", ":9091")} |
| 645 | opts.OptArgs = []string{"server", "--config-file", configFile} |
| 646 | s, err := starter.NewStarter(opts) |
| 647 | if err != nil { |
| 648 | fmt.Fprintf(os.Stderr, "error: %s\n", err) |
| 649 | return |
| 650 | } |
| 651 | s.Run() |
| 652 | }, |
| 653 | } |
| 654 | } |
no test coverage detected