Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function (pageKey, nextPage) {
// add the current page to the params
// so middleware and make modifications if needed.
params.page = assemble.pages[pageKey];
utils.context(assemble, params);
// run steps in series so we can notify middleware
// before and after the page steps are done.
async.series([
// notify middleware before rendering the contents
notify(events.pageBeforeRender),
// render the page
function (nextRenderStep) {
assemble.log.debug('\t[render]:', 'rendering pages');
assemble.engine.render(params.page.content, params.context, assemble.config, function (err, content) {
assemble.log.debug('\t[render]:', 'rendering done.');
if (err) {
assemble.log.error(err);
return nextRenderStep(err);
}
assemble.pages[pageKey].content = content;
nextRenderStep();
return
}
let processors = []
let processorsNames = self.api.actions.globalMiddleware.slice(0)
// get action processor names
if (self.actionTemplate.middleware) { self.actionTemplate.middleware.forEach(m => { processorsNames.push(m) }) }
processorsNames.forEach(name => {
if (typeof self.api.actions.middleware[ name ].preProcessor === 'function') {
processors.push(next => { self.api.actions.middleware[ name ].preProcessor(self, next) })
}
})
async.series(processors, callback)
}
it('161.5 for DBA, the original password is ignored', function(done) {
var dbaConn, conn;
var tpass = 'secret';
async.series([
function(cb) {
oracledb.getConnection(
DBA_config,
function(err, connection) {
should.not.exist(err);
dbaConn = connection;
cb();
}
);
},
function(cb) {
dbaConn.changePassword(myUser, 'foobar', tpass, function(err) {
should.not.exist(err);
cb();
});
},
})
people.forEach(person => {
jobs.push(done => {
const url = baseUrl + '/source_index/person/' + person + '_' + city + '?parent=' + city
const payload = { name: person, city: city }
request.put(url, { body: JSON.stringify(payload) }, done)
})
})
})
jobs.push(done => {
setTimeout(done, 6000)
})
async.series(jobs, callback)
}
exports.process = function process(config) {
context.config = config;
context.api = configApis(config);
async.series([
buildMilestone,
getSprintIssues,
getClosedSprintIssues,
createJiraTasksOnGithub,
closeJiraTasks
], errorLog);
};
function forceExport(callback) {
return async.series([
getOriginal,
force
], callback);
function getOriginal(callback) {
return self.apos.docs.find(req, { workflowGuid: workflowGuid }).trash(null).published(null).toObject(function(err, _original) {
if (err) {
return callback(err);
}
if (!_original) {
return callback('notfound');
}
original = _original;
return callback(null);
});
}
function force(callback) {
function (done) {
usersCollection = connectedDb.collection('users');
async.series([
function (next) {
usersCollection.ensureIndex('_id', next);
},
function (next) {
usersCollection.ensureIndex('username', next);
},
function (next) {
usersCollection.ensureIndex('password', next);
}
], done);
},
function (done) {
runable: function (self) {
async.series(ChildJobs.map(function (ChildJob) {
return function (next) {
self.invoke(ChildJob, next);
};
}), function (err, result) {
if (self.context.hasFailed()) {
err = new Error(`QueueFailed: ${err && err.message}`);
}
self.done(err, result);
});
}
}
depthTasks.push(function(callback){
_this.getMarketDepthFromPoloniex('BTC', symbol, marketData['BTC'].bid, callback)
});
}
if (marketData.hasOwnProperty('LTC') && marketData['LTC'].bid > 0){
depthTasks.push(function(callback){
_this.getMarketDepthFromPoloniex('LTC', symbol, marketData['LTC'].bid, callback)
});
}
});
if (!depthTasks.length){
taskCallback();
return;
}
async.series(depthTasks, function(err){
if (err){
taskCallback(err);
return;
}
taskCallback();
});
}
], function(err){
closeAMQPCommunication(callback) {
async.series([(seriesCallback) => {
this.channel.close(1, 200, 'Closing channel');
this.once('1:channel.close-ok', () => {
seriesCallback();
});
}, (seriesCallback) => {
this.connection.close(200, 'Closing channel');
this.once('connection.close-ok', () => {
seriesCallback();
});
}, (seriesCallback) => {
clearInterval(this.heartbeatIntervalId);
seriesCallback();
}], callback);
}
setFrameMax(frameMax) {