Add max option back for safety

This commit is contained in:
Crawl
2017-05-16 04:58:13 +02:00
parent 8beefe66d5
commit 4955b1ce5f

View File

@@ -56,8 +56,8 @@ class MessageCollector extends Collector {
* @private
*/
postCheck() {
if (this.collected.size >= this.options.max) return 'limit';
else if (this.options.maxProcessed && this.received === this.options.maxProcessed) return 'processedLimit';
if (this.options.max && this.collected.size >= this.options.max) return 'limit';
if (this.options.maxProcessed && this.received === this.options.maxProcessed) return 'processedLimit';
return null;
}