我需要访问 Bull-queue 以查看工作统计信息并显示在页面上。我正在使用bull-repl从 CLI 访问队列,如下所示:
> bull-repl
BULL-REPL> connect marathon reddis://localhost:6379
Connected to reddis://localhost:6379, queue: marathon
BULL-REPL | marathon> stats
??????????????????????
? (index) ? Values ?
??????????????????????
? waiting ? 0 ?
? active ? 0 ?
? completed ? 55 ?
? failed ? 1 ?
? delayed ? 0 ?
? paused ? 0 ?
??????????????????????
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下代码从 JS 中执行相同的操作:
const shell = require('shelljs');
const ccommandExistsSync = require('command-exists').sync;
function installBullRepl(){
if(ccommandExistsSync('bull-repl')){
queueStats();
} else{
shell.exec('npm i -g …Run Code Online (Sandbox Code Playgroud)