diff --git a/gulpfile.babel.js b/gulpfile.babel.js index cffac83eee8..60e8f0b19ef 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -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); + }); diff --git a/scripts/build-algolia.js b/scripts/build-algolia.js index b14165ffbd9..39434be1fb7 100755 --- a/scripts/build-algolia.js +++ b/scripts/build-algolia.js @@ -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); }