Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Note: Tests that failed but can still run again are pushed back into the queue.
// This push happens before the queue is given back flow control (at the end of
// this callback), which means that the queue isn't given the chance to drain.
if (!test.canRun()) {
this.queue.enqueue(test, constants.TEST_PRIORITY.RETRY);
enqueueNote = clc.cyanBright(`(will retry, ${test.maxAttempts - test.attempts}` +
` time(s) left). Spent ${test.getRuntime()} ms`);
}
break;
case Test.TEST_STATUS_NEW:
// no available resource
status = clc.yellowBright("RETRY");
this.queue.enqueue(test, constants.TEST_PRIORITY.RETRY);
enqueueNote = clc.cyanBright("(will retry). ") + clc.redBright(error.message);
break;
}
const failedTests = this.queue.getFailedTests();
const passedTests = this.queue.getPassedTests();
let prefix = `(${failedTests.length + passedTests.length} ` +
`/ ${this.queue.getTestAmount()})`;
if (test.attempts > 1) {
// this is a retry
prefix = "(retry)";
}
if (!this.serial && test.workerIndex > 0) {
prefix += ` <-- Worker ${test.workerIndex}`;
function merge(nextStep) {
console.log(clc.blackBright(' remove relationships:'), relToBeRemoved)
console.log(clc.blackBright(' update relationships:'), relToBeUpdated)
if(relToBeUpdated.length + relToBeRemoved.length == 0) {
console.log(clc.blackBright(' nothing to do, skipping', clc.cyanBright(JSON.stringify(ids))));
nextGroup();
return;
};
inquirer.prompt([{
type: 'confirm',
name: 'confirm',
message: ' Press enter to MERGE or REMOVE the selected relationships, otherwise SKIP by typing "n"',
}], function (answers) {
if(answers.confirm) {
nextGroup();
return;
} else {
console.log(clc.blackBright(' skipped, nothing changed for', clc.cyanBright(JSON.stringify(ids))));
nextGroup();
return;
}
], function (err) {
if(err){
console.log(err)
console.log(clc.blackBright('waterfall for'),clc.yellowBright('maintenance.entities'), clc.redBright('failed'))
} else {
console.log(clc.blackBright('waterfall for'),clc.yellowBright('maintenance.entities'), clc.cyanBright('completed'))
}
});
return;
notice = string => options.parent.noColors ? string : clc.cyanBright(string),
userIsSure = false,
notice = function(text) { util.log(clc.cyanBright(text)) };
notice = string => options.parent.noColors ? string : clc.cyanBright(string),
ok = string => options.parent.noColors ? string : clc.green.bold(string),
await Promise.all(data.map(async data => {
const { name } = data
Logger.info(`${cyanBright('[GENERATING]')}${red('[IMAGES]')} ${name}`)
const { metaData, paths } = await this.generator.generateImages(data)
Logger.info(`${cyanBright('[GENERATING]')}${magentaBright('[METADATA]')} ${name}`)
await this.generator.generateMetaData(metaData, name)
Logger.info(`${cyanBright('[GENERATING]')}${bgBlue('[SPRITESHEET]')} ${name}`)
await this.generator.generateSpritesheet(paths, name)
Logger.info(`${cyanBright('[GENERATING]')}${green('[DONE]')} ${name}`)
}))