Skip to content

Commit

Permalink
Skip sending welcome notifications if it's not set
Browse files Browse the repository at this point in the history
  • Loading branch information
previnder committed Jan 15, 2025
1 parent b3521ac commit d7c8327
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func serve(ctx *cli.Context) error {
return err
}, time.Hour, false)
tr.New("Send welcome notifications", func(ctx context.Context) error {
if conf.WelcomeCommunity == "" {
log.Println("Config.WelcomeCommunity is empty; skipping sending welcome notifications.")
return nil
}
n, err := core.SendWelcomeNotifications(ctx, db, conf.WelcomeCommunity, time.Hour*6)
if n > 0 {
log.Printf("%d welcome notifications successfully sent\n", n)
Expand Down

0 comments on commit d7c8327

Please sign in to comment.