From 57774cd347d41b4fbae20599e69c0a0eef0fc7bf Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Mon, 16 Oct 2023 23:14:58 +0200 Subject: [PATCH] fixed the feedback_email killing the backend if not configured correctly via passing Fatal log messages --- server/backend/cron/feedback_email.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/backend/cron/feedback_email.go b/server/backend/cron/feedback_email.go index c5321b5e..c1ffa02f 100644 --- a/server/backend/cron/feedback_email.go +++ b/server/backend/cron/feedback_email.go @@ -94,12 +94,12 @@ func (c *CronService) feedbackEmailCron() error { var results []model.Feedback if err := c.db.Find(&results, "processed = false").Scan(&results).Error; err != nil { - log.WithError(err).Fatal("could not get unprocessed feedback") + log.WithError(err).Error("could not get unprocessed feedback") return err } parsedHtmlBody, parsedTxtBody, err := parseTemplates() if err != nil { - log.WithError(err).Fatal("could not parse email templates") + log.WithError(err).Error("could not parse email templates") return err } @@ -138,7 +138,7 @@ func (c *CronService) feedbackEmailCron() error { func setupSMTPDialer() (*gomail.Dialer, error) { smtpPort, err := strconv.Atoi(os.Getenv("SMTP_PORT")) if err != nil { - log.WithError(err).Fatal("SMTP_PORT is not an integer") + log.WithError(err).Error("SMTP_PORT is not an integer") return nil, err } d := gomail.NewDialer(os.Getenv("SMTP_URL"), smtpPort, os.Getenv("SMTP_USERNAME"), os.Getenv("SMTP_PASSWORD"))