小编Yur*_*nev的帖子

访问 Bull-queue 以查看来自 nodejs 的作业统计信息

我需要访问 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)

task-queue node.js shelljs

3
推荐指数
1
解决办法
5919
查看次数

标签 统计

node.js ×1

shelljs ×1

task-queue ×1