Skip to content

Commit 551b709

Browse files
committed
Fix wait
1 parent 90b0fe7 commit 551b709

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/send-mail.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createTransport, SendMailOptions } from "nodemailer";
22
import SMTPTransport = require("nodemailer/lib/smtp-transport");
33
import { decode } from "rfc2047";
4-
import {setTimeout} from 'timers/promises'
54

65
export interface IParsedMBox {
76
body: string;
@@ -182,7 +181,7 @@ export async function sendMail(mail: IParsedMBox,
182181
Object.assign(transportOpts, JSON.parse(smtpOpts));
183182
}
184183

185-
await setTimeout(1000); // Sleep for 1 second
184+
await new Promise(res => setTimeout(res, 1000)); // Sleep for 1 second
186185

187186
return new Promise<string>((resolve, reject) => {
188187
const transporter = createTransport(transportOpts);

0 commit comments

Comments
 (0)