content: Error: job "121308" is invalid
nodejs app退出意外。 我引用了代码并且不知道原因。
/**
* Get job with `id` and callback `fn(err, job)`.
*
* @param {Number} id
* @param {String} jobType is optional
* @param {Function} fn
* @api public
*/
exports.get = function( id, jobType, fn ) {
if (id === null || id === undefined) {
return fn(new Error('invalid id param'));
}
if (typeof jobType === 'function' && !fn) {
fn = jobType;
jobType = '';
}
var client = redis.client()
, job = new Job;
job.id = id;
job.zid = client.createFIFO(id);
client.hgetall(client.getKey('job:' + job.id), function( err, hash ) {
if( err ) return fn(err);
if( !hash ) {
exports.removeBadJob(job.id, jobType);
return fn(new Error('job "' + job.id + '" doesnt exist'));
}
if( !hash.type ) {
exports.removeBadJob(job.id, jobType);
return fn(new Error('job "' + job.id + '" is invalid'))
}
.....
有人问过这个问题吗?