kopia lustrzana https://github.com/c9/core
Make sure we always send the "predict" event
rodzic
f31b8b92d4
commit
726a40fb87
|
@ -390,26 +390,32 @@ define(function(require, exports, module) {
|
||||||
predict = predictions.splice(0, i + 1);
|
predict = predictions.splice(0, i + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit("predict", {
|
return done(null, predict);
|
||||||
data: e.data,
|
|
||||||
session: session,
|
|
||||||
predictions: predict
|
|
||||||
});
|
|
||||||
return callback(null, predict);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No matches. But one got really close.
|
// No matches. But one got really close.
|
||||||
if (matchedOneOff)
|
if (matchedOneOff)
|
||||||
return callback(null, []);
|
return done(null, []);
|
||||||
|
|
||||||
// No matches. Return if our predictions were optional.
|
// No matches. Return if our predictions were optional.
|
||||||
if (isOptionalOnly(predictions))
|
if (isOptionalOnly(predictions))
|
||||||
return callback(null, []);
|
return done(null, []);
|
||||||
|
|
||||||
// No matches for our predictions :( We likely made a mistake.
|
// No matches for our predictions :( We likely made a mistake.
|
||||||
// Reporting false here ensures we catch mistakes early.
|
// Reporting false here ensures we catch mistakes early.
|
||||||
return callback(null, false);
|
return done(null, false);
|
||||||
|
|
||||||
|
function done(err, result) {
|
||||||
|
if (result) {
|
||||||
|
emit("predict", {
|
||||||
|
data: e.data,
|
||||||
|
session: session,
|
||||||
|
predictions: predict
|
||||||
|
});
|
||||||
|
}
|
||||||
|
callback(err, result, line);
|
||||||
|
}
|
||||||
|
|
||||||
function matchPrediction(prediction) {
|
function matchPrediction(prediction) {
|
||||||
var predict = prediction.after.predict;
|
var predict = prediction.after.predict;
|
||||||
|
|
Ładowanie…
Reference in New Issue