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 env: env
}; };
return exec('giddyup leader check', opts, function(err, stdout, stderr) {
console.log('Error:', err); console.log('Waiting');
console.log('Stdout:', stdout); setTimeout(() => {
console.log('Stderr:', stderr); console.log('Done');
}).on('close', code => { exec('giddyup leader check', opts, function(err, stdout, stderr) {
if (code === 0) { console.log('Error:', err);
console.log('Publishing to algolia', process.env.ALGOLIA_INDEX_NAME); console.log('Stdout:', stdout);
atomicalgolia(process.env.ALGOLIA_INDEX_NAME, process.env.ALGOLIA_INDEX_FILE, (err, result) => { console.log('Stderr:', stderr);
console.log(result); }).on('close', code => {
cb(err); if (code === 0) {
}); console.log('Publishing to algolia', process.env.ALGOLIA_INDEX_NAME);
} else { atomicalgolia(process.env.ALGOLIA_INDEX_NAME, process.env.ALGOLIA_INDEX_FILE, (err, result) => {
console.log('I am not the leader (' + code + ')'); console.log(result);
cb(new Error('Not the leader')); 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 // objectID is not quite unique yet so hash the entire object
paragraphOut.objectID = md5(JSON.stringify(paragraphOut)); paragraphOut.objectID = md5(JSON.stringify(paragraphOut));
if (paragraphOut.objectID === "d41d8cd98f00b204e9800998ecf8427e") {
console.log(paragraphOut)
console.log(JSON.stringify(paragraphOut))
}
nue.push(paragraphOut); nue.push(paragraphOut);
} }