浏览代码

EAGLESIX-3082: Corrections made in accordance with comments.

Scott Munday 11 年之前
父节点
当前提交
489b28b055
共有 1 个文件被更改,包括 8 次插入2 次删除
  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 {*}
  * @returns {*}
  */
  */
 proto.getNext = function getNext(callback) {
 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,
 	var self = this,
 		next;
 		next;
@@ -167,7 +173,7 @@ klass.isSplittableDocumentSource = true;
  * @returns {number}
  * @returns {number}
  */
  */
 proto.getDependencies = function getDependencies(deps) {
 proto.getDependencies = function getDependencies(deps) {
-	return 1; // SEE_NEXT
+	return DocumentSource.GetDepsReturn.SEE_NEXT;
 };
 };
 
 
 /**
 /**