+ private reactiveStuckJobs () {
+ const promises: Promise<any>[] = []
+
+ this.jobQueue.active((err, ids) => {
+ if (err) throw err
+
+ for (const id of ids) {
+ kue.Job.get(id, (err, job) => {
+ if (err) throw err
+
+ const p = new Promise((res, rej) => {
+ job.inactive(err => {
+ if (err) return rej(err)
+ return res()
+ })
+ })
+
+ promises.push(p)
+ })
+ }
+ })
+
+ return Promise.all(promises)
+ }
+