Added --disable-mailer flag to prevent starting the built-in mailer. Fixes #935

pull/1003/head
Jordan Wright 2018-02-22 22:26:59 -06:00
parent 3d58d8362e
commit 1426376aa5
No known key found for this signature in database
GPG Key ID: 138D5AD2331B3C11
1 changed files with 7 additions and 2 deletions

View File

@ -49,7 +49,8 @@ import (
var ( var (
Logger = log.New(os.Stdout, " ", log.Ldate|log.Ltime|log.Lshortfile) Logger = log.New(os.Stdout, " ", log.Ldate|log.Ltime|log.Lshortfile)
configPath = kingpin.Flag("config", "Location of config.json.").Default("./config.json").String() configPath = kingpin.Flag("config", "Location of config.json.").Default("./config.json").String()
disableMailer = kingpin.Flag("disable-mailer", "Disable the mailer (for use with multi-system deployments)").Bool()
) )
func main() { func main() {
@ -70,7 +71,11 @@ func main() {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()
go mailer.Mailer.Start(ctx)
// Provide the option to disable the built-in mailer
if !*disableMailer {
go mailer.Mailer.Start(ctx)
}
// Setup the global variables and settings // Setup the global variables and settings
err = models.Setup() err = models.Setup()
if err != nil { if err != nil {