Skip to content

Commit

Permalink
Update email.go
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianKohler authored Feb 17, 2025
1 parent 02da111 commit 491a3db
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/messenger/email/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ func (e *Emailer) Flush() error {
return nil
}

// Retrieve the retry delay from the configuration
retryDelay := time.Duration(config.RetryDelay) * time.Second

Check failure on line 194 in internal/messenger/email/email.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body

// Implement retry logic
var err error
for i := 0; i < maxRetries; i++ {

Check failure on line 198 in internal/messenger/email/email.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body
err = sendSMTPMail(...)
if err == nil {
break
}
time.Sleep(retryDelay) // Wait for the retry delay before the next attempt
}

// Close closes the SMTP pools.
func (e *Emailer) Close() error {
for _, s := range e.servers {
Expand Down

0 comments on commit 491a3db

Please sign in to comment.