cmd

package
v0.0.0-...-52789aa Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "metronome-aggregator",
	Short: "Metronome aggregator update task database",
	Long: `Metronome is a distributed and fault-tolerant event scheduler built with love by ovh teams and friends in Go.
Complete documentation is available at http://ovh.github.io/metronome`,
	Run: func(cmd *cobra.Command, args []string) {
		log.Info("Metronome Aggregator starting")

		metrics.Serve()

		tc, err := consumers.NewTaskConsumer()
		if err != nil {
			log.WithError(err).Fatal("Could not start the task consumer")
		}

		sc, err := consumers.NewStateConsumer()
		if err != nil {
			log.WithError(err).Fatal("Could not start the state consumer")
		}

		log.Info("Started")

		sigint := make(chan os.Signal, 1)
		signal.Notify(sigint, os.Interrupt)

		<-sigint

		log.Info("Shuting down")
		if err := sc.Close(); err != nil {
			log.WithError(err).Error("Could not stop gracefully the state consumer")
		}

		if err := tc.Close(); err != nil {
			log.WithError(err).Error("Could not stop gracefully the task consumer")
		}
	},
}

RootCmd launch the aggregator agent.

Functions

This section is empty.

Types

This section is empty.

Source Files

  • root.go
  • version.go

Jump to

Keyboard shortcuts

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