Explorar o código

add a process to delete email addresses from failedToSendEmailList

Shun Miyazawa %!s(int64=4) %!d(string=hai) anos
pai
achega
df36f0bdcb
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/server/routes/apiv3/users.js

+ 6 - 1
src/server/routes/apiv3/users.js

@@ -143,7 +143,12 @@ module.exports = (crowi) => {
     await Promise.allSettled(promise)
       .then((results) => {
         results.forEach((result) => {
-          console.log(result);
+          if (result.status === 'fulfilled') {
+            const email = result.value.accepted[0];
+            const index = failedToSendEmailList.indexOf(email);
+            // remove faild send email
+            failedToSendEmailList.splice(index, 1);
+          }
         });
       });