Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init () {
if (!this._instance) {
const config = this.config[this.config.service]
if (this.config.prefix) config.prefix = this.config.prefix
if (this.config.concurrency) config.concurrency = this.config.concurrency
if (this.config.canStartQueue) config.canStartQueue = this.config.canStartQueue
ironium.configure(config)
this._instance = ironium
if (this.config.log_errors) {
this._instance.onerror(function (error, subject) {
this.Logger.error(`IRONIUM :: Error reported by: ${subject}`)
this.Logger.error(error.stack)
})
}
for (const job of this.jobs) {
this._instance.queue(job.constructor.name).eachJob(job.handle)
}
}
}