do not use .finally() because of Node v8

This commit is contained in:
Andris Reinman 2019-10-01 16:27:10 +03:00
parent bc23a35119
commit 7c5bf84c52

View file

@ -493,15 +493,20 @@ class MessageHandler {
}
};
return processAudits().finally(() => {
return cleanup(null, true, {
let next = () => {
cleanup(null, true, {
uidValidity,
uid,
id: messageData._id,
mailbox: mailboxData._id,
status: 'new'
});
});
};
// do not use more suitable .finally() as it is not supported in Node v8
return processAudits()
.then(next)
.catch(next);
}
);
});