Debug the pipes

This commit is contained in:
Westly Wright
2018-07-10 14:43:37 -07:00
parent 9eb546a818
commit 0342cf28f0
2 changed files with 26 additions and 16 deletions
+22 -16
View File
@@ -194,20 +194,26 @@ gulp.task('publish:search-index', (cb) => {
env: env
};
return exec('giddyup leader check', opts, function(err, stdout, stderr) {
console.log('Error:', err);
console.log('Stdout:', stdout);
console.log('Stderr:', stderr);
}).on('close', code => {
if (code === 0) {
console.log('Publishing to algolia', process.env.ALGOLIA_INDEX_NAME);
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, process.env.ALGOLIA_INDEX_FILE, (err, result) => {
console.log(result);
cb(err);
});
} else {
console.log('I am not the leader (' + code + ')');
cb(new Error('Not the leader'));
}
});
console.log('Waiting');
setTimeout(() => {
console.log('Done');
exec('giddyup leader check', opts, function(err, stdout, stderr) {
console.log('Error:', err);
console.log('Stdout:', stdout);
console.log('Stderr:', stderr);
}).on('close', code => {
if (code === 0) {
console.log('Publishing to algolia', process.env.ALGOLIA_INDEX_NAME);
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, process.env.ALGOLIA_INDEX_FILE, (err, result) => {
console.log(result);
cb(err);
});
} else {
console.log('I am not the leader (' + code + ')');
cb(new Error('Not the leader'));
}
});
}, 10000);
});
+4
View File
@@ -65,6 +65,10 @@ nodes.forEach(node => {
// objectID is not quite unique yet so hash the entire object
paragraphOut.objectID = md5(JSON.stringify(paragraphOut));
if (paragraphOut.objectID === "d41d8cd98f00b204e9800998ecf8427e") {
console.log(paragraphOut)
console.log(JSON.stringify(paragraphOut))
}
nue.push(paragraphOut);
}