cmd

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2019 License: NCSA Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:          "raid",
	Short:        "The server is used to accept jobs from the rai queue.",
	SilenceUsage: true,
	RunE: func(cmd *cobra.Command, args []string) error {

		defer func() {
			if com.IsDir(config.App.TempDir) {
				os.RemoveAll(config.App.TempDir)
			}
		}()

		death := death.NewDeath(syscall.SIGINT, syscall.SIGTERM)

		options := []server.Option{
			server.Stdout(os.Stdout),
			server.Stderr(os.Stderr),
			server.NumWorkers(2),
		}

		if clientJobQueueName != "" {
			options = append(options, server.JobQueueName(clientJobQueueName))
		}

		server, err := server.New(options...)
		if err != nil {
			return err
		}

		if err := server.Connect(); err != nil {
			return err
		}

		if config.IsDebug || config.IsVerbose {
			death.SetLogger(log)
		}

		death.WaitForDeath(server, prof{})

		return nil
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL