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

This commit is contained in:
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

View file

@ -49,7 +49,8 @@ import (
var (
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() {
@ -70,7 +71,11 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
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
err = models.Setup()
if err != nil {