-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load balance email clients #153
Conversation
auth/email_link/email_modify.go
Outdated
@@ -128,16 +129,16 @@ func (c *client) sendNotifyEmailChanged(ctx context.Context, notifyEmail, newEma | |||
}{ | |||
AppName: c.cfg.AppName, | |||
} | |||
|
|||
return errors.Wrapf(c.emailClient.Send(ctx, &email.Parcel{ | |||
from := c.fromRecipients[atomic.AddUint64(&c.emailClientLBIndex, 1)%uint64(len(c.emailClients))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract the idx in a var cuz otherwise u'll have 2 different ones for fromRecipients and clients
auth/email_link/emaillink.go
Outdated
db: db, | ||
authClient: authClient, | ||
userModifier: userModifier, | ||
emailClients: make([]email.Client, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0, cfg.Extra...
auth/email_link/emaillink.go
Outdated
authClient: authClient, | ||
userModifier: userModifier, | ||
emailClients: make([]email.Client, 0), | ||
fromRecipients: make([]fromRecipient, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0, cfg.Extra...
auth/email_link/link_start_auth.go
Outdated
|
||
return errors.Wrapf(c.emailClient.Send(ctx, &email.Parcel{ | ||
return errors.Wrapf(c.emailClients[atomic.AddUint64(&c.emailClientLBIndex, 1)%uint64(len(c.emailClients))].Send(ctx, &email.Parcel{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here
auth/email_link/emaillink.go
Outdated
db: db, | ||
authClient: authClient, | ||
userModifier: userModifier, | ||
emailClients: make([]email.Client, 0, cfg.ExtraLoadBalancersCount), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually its Extra+1
3c5f703
to
3094a01
Compare
No description provided.