/* * Insert document into cluster. */ report(data) { const {client, index, type} = this; // Insert document into cluster. return Promise.fromNode(cb => { client.index({index, type, body: data}, cb); }); }
// Main logix Promise.fromNode(cb => { api.listen(config.LANDO_METRICS_PORT, cb); }) .then(() => { log.info('Listening on port: %s', config.LANDO_METRICS_PORT); });
/* * Ping connection. */ ping() { const client = this.client; return Promise.fromNode(cb => { client.ping(cb); }) .then(success => { if (!success) { return Promise.reject({ status: 502, message: 'Could not reach the elasticsearch instance!', }); } }); }
// Start listening Promise.fromNode(cb => { api.listen(config.LANDO_API_PORT, cb); }) // Load our routes .then(() => { fs.readdirSync(path.join(__dirname, 'routes')).map(file => { require(`./routes/${file}`)(api, handler, {config, slack}); log.info('Loaded route %s', file); }); log.info('Listening on port: %s', config.LANDO_API_PORT); });
function ls (cache) { return BB.fromNode(cb => { lsStream(cache).on('error', cb).pipe(concat(entries => { cb(null, entries.reduce((acc, xs) => { acc[xs.key] = xs return acc }, {})) })) }) }
function reset (testDir) { cacache.clearMemoized() process.chdir(__dirname) return BB.fromNode(cb => { rimraf(testDir, function (err) { if (err) { return cb(err) } mkdirp(testDir, function (err) { if (err) { return cb(err) } process.chdir(testDir) cb() }) }) }) }
return getStream.buffer(pack).then(ret => { if (opts.gzip) { return BB.fromNode(cb => zlib.gzip(ret, cb)) } else { return ret
return Bluebird.fromNode(cb => { new Auditor( npm.prefix,
function _reqLoop (n) { return BB.fromNode(cb => { request({ uri: URL, headers: { gzip: true } }, cb) }).then(() => { if (n > 0) { return _reqLoop(n - 1) } }) }
return BB.fromNode(cb => { fs.link(src, dest, err => { if (err) {
return fs.readFileAsync(path.join(testDir, file)).then(JSON.parse) return BB.fromNode((cb) => { common.npm([ 'install',
/* * Insert document into cluster. */ report(data) { const {client, index, type} = this; // Insert document into cluster. return Promise.fromNode(cb => { client.index({index, type, body: data}, cb); }); }
// Main logix Promise.fromNode(cb => { api.listen(config.LANDO_METRICS_PORT, cb); }) .then(() => { log.info('Listening on port: %s', config.LANDO_METRICS_PORT); });
/* * Ping connection. */ ping() { const client = this.client; return Promise.fromNode(cb => { client.ping(cb); }) .then(success => { if (!success) { return Promise.reject({ status: 502, message: 'Could not reach the elasticsearch instance!', }); } }); }