Pārlūkot izejas kodu

EAGLESIX-3082: Corrections made in accordance with comments.

Scott Munday 11 gadi atpakaļ
vecāks
revīzija
489b28b055
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. 8 2
      lib/pipeline/documentSources/SkipDocumentSource.js

+ 8 - 2
lib/pipeline/documentSources/SkipDocumentSource.js

@@ -63,7 +63,13 @@ proto.coalesce = function coalesce(nextSource) {
  * @returns {*}
  */
 proto.getNext = function getNext(callback) {
-	if (!callback) throw new Error(this.getSourceName() + ' #getNext() requires callback.');
+	if (!callback) {
+		throw new Error(this.getSourceName() + ' #getNext() requires callback.');
+	}
+
+	if (this.expCtx.checkForInterrupt && this.expCtx.checkForInterrupt() === false) {
+		return callback(new Error('Interrupted'));
+	}
 
 	var self = this,
 		next;
@@ -167,7 +173,7 @@ klass.isSplittableDocumentSource = true;
  * @returns {number}
  */
 proto.getDependencies = function getDependencies(deps) {
-	return 1; // SEE_NEXT
+	return DocumentSource.GetDepsReturn.SEE_NEXT;
 };
 
 /**