MCPcopy Index your code
hub / github.com/bee-queue/bee-queue / fromId

Method fromId

lib/job.js:20–32  ·  view source on GitHub ↗
(queue, jobId, cb)

Source from the content-addressed store, hash-verified

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

Callers 3

getJobMethod · 0.80
_waitForJobMethod · 0.80
job-test.jsFile · 0.80

Calls 3

_commandableMethod · 0.80
toKeyMethod · 0.80
fromDataMethod · 0.80

Tested by

no test coverage detected