(queue, jobId, cb)
| 18 | } |
| 19 | |
| 20 | static fromId(queue, jobId, cb) { |
| 21 | const promise = queue |
| 22 | ._commandable() |
| 23 | .then((client) => |
| 24 | helpers.callAsync((done) => |
| 25 | client.hget(queue.toKey('jobs'), jobId, done) |
| 26 | ) |
| 27 | ) |
| 28 | .then((data) => (data ? Job.fromData(queue, jobId, data) : null)); |
| 29 | |
| 30 | if (cb) helpers.asCallback(promise, cb); |
| 31 | return promise; |
| 32 | } |
| 33 | |
| 34 | static fromData(queue, jobId, data) { |
| 35 | // no need for try-catch here since we made the JSON ourselves in Job#toData |
no test coverage detected