(progress, cb)
| 162 | } |
| 163 | |
| 164 | reportProgress(progress, cb) { |
| 165 | let promise; |
| 166 | if (progress != null) { |
| 167 | this.progress = progress; |
| 168 | promise = this.queue._commandable().then((client) => |
| 169 | helpers.callAsync((done) => |
| 170 | client.publish( |
| 171 | this.queue.toKey('events'), |
| 172 | JSON.stringify({ |
| 173 | id: this.id, |
| 174 | event: 'progress', |
| 175 | data: progress, |
| 176 | }), |
| 177 | done |
| 178 | ) |
| 179 | ) |
| 180 | ); |
| 181 | } else { |
| 182 | promise = Promise.reject(new Error('Progress cannot be empty')); |
| 183 | } |
| 184 | |
| 185 | if (cb) helpers.asCallback(promise, cb); |
| 186 | return promise; |
| 187 | } |
| 188 | |
| 189 | remove(cb) { |
| 190 | const promise = this.queue.removeJob(this.id).then(() => this); |
nothing calls this directly
no test coverage detected