Add default value for mailer

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-10-23 12:34:21 +02:00
parent 1097874639
commit b2f2d463e7

View File

@@ -56,6 +56,11 @@ func NewMailer(pg *pg.Client, l *log.Logger, cfg Config) *Mailer {
cfg.Timeout = 10 * time.Second
}
// Set a default interval if not provided
if cfg.Interval == 0 {
cfg.Interval = 60 * time.Second
}
return &Mailer{pg: pg, l: l, cfg: cfg, interval: cfg.Interval}
}