Skip to content

Commit

Permalink
wip fix sendMail
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Nov 27, 2024
1 parent 230a5f7 commit 4a7cbc2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions lib/Auth/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const getTransporter = (smptConfig: SMTPConfig) => {

const send = (transporter: Transporter, email: Email) => {
return new Promise((resolve, reject) => {
transporter.once('idle', () => {
const doSend = () => {
if (transporter.isIdle()) {
transporter.sendMail(
email,
Expand All @@ -82,6 +82,11 @@ const send = (transporter: Transporter, email: Email) => {
}
);
}
});
}
if(transporter.isIdle()){
doSend();
} else {
transporter.once('idle', doSend);
}
});
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prostgles-server",
"version": "4.2.164",
"version": "4.2.165",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4a7cbc2

Please sign in to comment.