TypeError: Cannot read property 'zcard' of null
at Queue.card (/Users/narain/Sites/integrity-automation/node_modules/kue/lib/kue.js:513:14)
at Queue.inactiveCount (/Users/narain/Sites/integrity-automation/node_modules/kue/lib/kue.js:616:17)
at _ (/Users/narain/Sites/integrity-automation/node_modules/kue/lib/http/routes/json.js:318:19)
at exports.stats (/Users/narain/Sites/integrity-automation/node_modules/kue/lib/http/routes/json.js:41:3)
at Layer.handle [as handle_request] (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/route.js:131:13)
at /Users/narain/Sites/integrity-automation/node_modules/kue/lib/http/middleware/provides.js:11:36
at Layer.handle [as handle_request] (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/layer.js:95:5)
at /Users/narain/Sites/integrity-automation/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/index.js:330:12)
at next (/Users/narain/Sites/integrity-automation/node_modules/express/lib/router/index.js:271:10)
at SendStream.error (/Users/narain/Sites/integrity-automation/node_modules/serve-static/index.js:120:7)
at emitOne (events.js:77:13)
at SendStream.emit (events.js:169:7)
at SendStream.error (/Users/narain/Sites/integrity-automation/node_modules/send/index.js:245:17)
at SendStream.onStatError (/Users/narain/Sites/integrity-automation/node_modules/send/index.js:356:12)
at next (/Users/narain/Sites/integrity-automation/node_modules/send/index.js:630:16)
at onstat (/Users/narain/Sites/integrity-automation/node_modules/send/index.js:619:14)
at FSReqWrap.oncomplete (fs.js:82:15)
在以下情况下,我经常收到此错误:
- 在浏览器窗口中打开 kui-ui 仪表板
- 执行正常关机
我不确定它是否应该为Queue.client
空。如果是,那么应该在调用之前Queue.prototype.card
先检查是否存在。与this.client
this.client.card
Queue.prototype.cardByType
这是我的 api 路由dashboard/stop
代码(即停止进程并刷新缓存):
exports.stop = function(success, failure) {
let shutdown = new Promise((resolve, reject) => {
debug('shutting down queue');
queue.shutdown().then(() => {
client.flushdb(); // flushing the redis server
debug('redis is flushed');
resolve({success: true});
},
(err) => {
reject(err);
});
});
return shutdown;
};
注意:queue
是Kue
和client
的一个实例redis
:
let queue = require('kue').createQueue({prefix: '', redis: config.get('redisurl'), jobEvents: false});
let client = require('redis').createClient({
'url': config.get('redis') // redis-url
});
github上也提出了相同的问题(issue):
而且还没反应。。
任何想法/想法!如何得到这个修复..?