Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.save(async (err, $job) => { // See: https://github.com/bee-queue/bee-queue/issues/147
if (err) {
console.error(`@@adonisjs/Queue: failed in creating job id=${this._jobUuid} on queue: ${_name}`)
// Known error when redis has not all lua scripts loaded properly
if (err.command === 'EVALSHA') {
await bqScripts.buildCache(this.getByName(_name))
console.info(`@@adonisjs/Queue: successfully reloaded Lua scripts into cache; retrying job creation id=${this._jobUuid}`)
// try to create job again
try {
await queue.removeJob(this._jobUuid)
} catch (ex) { $job = null } finally {
_job = $job || queue.createJob(job.makeArg(job))
_job.setId(this._jobUuid)
.timeout(job.timeOut || 0)
.backoff('fixed', job.retryUntil || 0)
.retries(job.retryCount || 2)
.delayUntil(job.delayUntil || 0)
.save()
}
}
jobs.forEach(({ key, handle }) => {
// desestruturado
// this.queues[key] = new Bee(key, {
// redis: redisConfig,
// }), //this
this.queues[key] = {
bee: new Bee(key, {
// objeto: fila
redis: redisConfig, // grava o trabalho no Redis
}), // this
handle, // vem lá do Job, metodo que vai processar
};
}); // foreach
} // init
jobs.forEach(({ key, handle }) => {
this.queues[key] = {
bee: new Bee(key, {
// here we store our queue
redis: redisConfig,
}),
handle, // this will process the current job
};
});
}
jobs.forEach(({ key, handle }) => {
this.queues[key] = {
bee: new Bee(key, {
redis: redisConfig,
}),
handle,
};
});
}
jobs.forEach(({ key, handle }) => {
this.queues[key] = {
bee: new Bee(key, {
redis: redisConfig,
}),
handle,
};
});
}