node_modules: update (#352)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-10-22 08:43:32 +02:00
1 parent 4026a70a6b
commit 47af4a10b5
53 files changed
+630 -217

No files matched your search

+25 -1
View File
@@ -100,6 +100,7 @@ class SMTPPool extends node_events_1.EventEmitter {
this._queue = [];
this._connections = [];
this._connectionCounter = 0;
this._pending = 0;
this.idling = true;
setImmediate(() => {
if (this.idling) {
@@ -132,10 +133,20 @@ class SMTPPool extends node_events_1.EventEmitter {
setImmediate(() => callback(err));
return false;
}
// counted until the callback runs, whichever path runs it: delivered, failed, requeued
// until it gives up, or drained by close()
let counted = true;
this._pending++;
this._queue.push({
mail,
requeueAttempts: 0,
callback
callback: (err, info) => {
if (counted) {
counted = false;
this._pending--;
}
callback(err, info);
}
});
if (this.idling && this._queue.length >= this.options.maxConnections) {
this.idling = false;
@@ -479,6 +490,19 @@ class SMTPPool extends node_events_1.EventEmitter {
isIdle() {
return this.idling;
}
/**
* Counts the messages the pool has not finished with yet: the ones waiting in the queue
* plus the ones a connection is transmitting right now. isIdle() only tells whether the
* pool can take another message, it is already true while a message is still being sent,
* so use this to check that nothing would be lost by closing the pool. A message that is
* re-queued after its connection dropped is counted until its callback runs, also while it waits to be put back on the queue, and
* it is no longer counted by the time its callback runs.
*
* @returns Number of queued and in-flight messages
*/
pendingCount() {
return this._pending;
}
verify(callback) {
let promise;
if (!callback) {