@bull-board/cli 9.6.1 → 9.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -0
- package/dist/bin.js +0 -12
- package/dist/bin.js.map +1 -1
- package/dist/config/connection.d.ts +19 -0
- package/dist/config/connection.js +99 -0
- package/dist/config/connection.js.map +1 -0
- package/dist/config/flags.d.ts +32 -0
- package/dist/config/flags.js +8 -0
- package/dist/config/flags.js.map +1 -1
- package/dist/config/resolve.js +31 -9
- package/dist/config/resolve.js.map +1 -1
- package/dist/config/types.d.ts +23 -2
- package/dist/connectionState.d.ts +6 -4
- package/dist/connectionState.js +17 -0
- package/dist/connectionState.js.map +1 -1
- package/dist/diagnosticPage.js +1 -1
- package/dist/diagnosticPage.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +27 -1
- package/dist/help.js.map +1 -1
- package/dist/history.d.ts +16 -0
- package/dist/history.js +46 -0
- package/dist/history.js.map +1 -0
- package/dist/index.js +51 -14
- package/dist/index.js.map +1 -1
- package/dist/registry.d.ts +1 -0
- package/dist/registry.js +3 -0
- package/dist/registry.js.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -28,6 +28,15 @@ Usage:
|
|
|
28
28
|
|
|
29
29
|
Options:
|
|
30
30
|
-r, --redis <url> Redis connection URL [redis://localhost:6379]
|
|
31
|
+
--sentinel <list> Comma separated sentinel host:port list, port [26379]
|
|
32
|
+
--sentinel-name <n> Redis master group name, required with --sentinel
|
|
33
|
+
--sentinel-password <pass>
|
|
34
|
+
Password for the sentinel nodes themselves
|
|
35
|
+
--redis-username <name>
|
|
36
|
+
Username for the Redis nodes behind the sentinels
|
|
37
|
+
--redis-password <pass>
|
|
38
|
+
Password for the Redis nodes behind the sentinels
|
|
39
|
+
--redis-db <n> Database to select behind the sentinels
|
|
31
40
|
-p, --port <port> Port to listen on [3000]
|
|
32
41
|
--host <address> Interface to bind [127.0.0.1]
|
|
33
42
|
--prefix <list> Comma separated key prefixes [bull]
|
|
@@ -38,6 +47,9 @@ Options:
|
|
|
38
47
|
--user <name> Basic auth user (requires --password)
|
|
39
48
|
--password <pass> Basic auth password (requires --user)
|
|
40
49
|
--board-title <s> Dashboard title
|
|
50
|
+
--history Record and serve long-retention metrics history
|
|
51
|
+
--history-retention-days <n>
|
|
52
|
+
Days of history to keep [90]
|
|
41
53
|
--config <file> Path to a config file
|
|
42
54
|
--browser <command> Command to open the browser with [$BROWSER]
|
|
43
55
|
--no-open Do not open a browser
|
|
@@ -64,6 +76,51 @@ module.exports = {
|
|
|
64
76
|
};
|
|
65
77
|
```
|
|
66
78
|
|
|
79
|
+
## Redis Sentinel
|
|
80
|
+
|
|
81
|
+
`--sentinel` connects through Redis Sentinel rather than to one instance directly, for a deployment where the master address is not fixed:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
npx @bull-board/cli --sentinel s1.internal:26379,s2.internal:26379 --sentinel-name mymaster
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
A port is optional per entry and defaults to 26379. `--sentinel-name` is the master group name from your sentinel configuration and is required. `--sentinel` and `--redis` are mutually exclusive, and passing both is an error rather than a silent preference for one.
|
|
88
|
+
|
|
89
|
+
ioredis resolves the current master through the sentinels listed and follows a failover on its own, so the whole dashboard moves with it: queue reads, the Bull subscriber, and `--history` recording all share the one connection.
|
|
90
|
+
|
|
91
|
+
Credentials in sentinel mode come from their own flags, since there is no URL to carry them. `--redis-username`, `--redis-password` and `--redis-db` apply to the Redis nodes behind the sentinels, while `--sentinel-password` authenticates to the sentinel nodes themselves, which commonly have a different password. Passing any of them alongside a Redis URL is an error, because ioredis would take the URL's own credentials and ignore them.
|
|
92
|
+
|
|
93
|
+
For anything beyond that, including TLS to the sentinel nodes, the config file's `redis` key accepts a full [ioredis options object](https://github.com/redis/ioredis#connect-to-redis) and is passed through untouched:
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
// bull-board.config.js
|
|
97
|
+
module.exports = {
|
|
98
|
+
redis: {
|
|
99
|
+
sentinels: [
|
|
100
|
+
{ host: 's1.internal', port: 26379 },
|
|
101
|
+
{ host: 's2.internal', port: 26379 },
|
|
102
|
+
],
|
|
103
|
+
name: 'mymaster',
|
|
104
|
+
sentinelPassword: process.env.SENTINEL_PASSWORD,
|
|
105
|
+
enableTLSForSentinelMode: true,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Historical metrics
|
|
111
|
+
|
|
112
|
+
`--history` turns on the long-retention metrics that otherwise need `@bull-board/metrics` wired into an app of your own:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
npx @bull-board/cli -r redis://localhost:6379 --history
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Every queue chart gains a 60m / 7d / 30d / 90d range selector, and a cross-queue Metrics history page shows up in the sidebar. The CLI process does the recording itself, copying throughput, wait time, run time and queue age into Redis once a minute under the `bull-board:metrics:` namespace, never over a key Bull or BullMQ owns. Recording follows discovery, so a queue that appears between rescans is picked up on the next tick.
|
|
119
|
+
|
|
120
|
+
`--history-retention-days` sets the window, 90 days by default. Per-tier retention, the snapshot interval and `latency: false` go in the config file under a `history` key. `--read-only` keeps the reading and stops the writing, for a board that only displays what another process records.
|
|
121
|
+
|
|
122
|
+
Completed and failed history comes out of BullMQ's own metrics buffer, so it stays empty unless your workers were built with `metrics: { maxDataPoints: MetricsTime.ONE_WEEK }`; the CLI warns at startup when no discovered queue has any. Latency and queue age need nothing from your workers. See the [historical metrics recipe](https://felixmosh.github.io/bull-board/recipes/historical-metrics) for storage sizing and what the charts show.
|
|
123
|
+
|
|
67
124
|
## Docker
|
|
68
125
|
|
|
69
126
|
```sh
|
package/dist/bin.js
CHANGED
|
@@ -30,18 +30,6 @@ async function main() {
|
|
|
30
30
|
explicitPath: flags.config || process.env.BULL_BOARD_CONFIG,
|
|
31
31
|
});
|
|
32
32
|
const config = (0, resolve_1.resolveConfig)({ flags, env: process.env, file });
|
|
33
|
-
if (!config.redisUrl.startsWith('/')) {
|
|
34
|
-
let parsed;
|
|
35
|
-
try {
|
|
36
|
-
parsed = new URL(config.redisUrl);
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
throw new Error(`Invalid Redis URL: ${config.redisUrl}`);
|
|
40
|
-
}
|
|
41
|
-
if (!['redis:', 'rediss:'].includes(parsed.protocol)) {
|
|
42
|
-
throw new Error(`Redis URL must use redis:// or rediss://, got "${parsed.protocol}//"`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
33
|
const board = await (0, index_1.run)(config, console, {
|
|
46
34
|
beforeReady: (close) => {
|
|
47
35
|
for (const signal of ['SIGINT', 'SIGTERM']) {
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;AACA,wCAA+C;AAC/C,0CAA4C;AAC5C,8CAAiD;AACjD,iCAA8B;AAC9B,mCAA8B;AAC9B,+CAA4C;AAE5C,KAAK,UAAU,IAAI;IACjB,IAAI,KAAoC,CAAC;IACzC,IAAI,CAAC;QACH,KAAK,GAAG,IAAA,kBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAI,KAAe,CAAC,OAAO,oCAAoC,CAAC,CAAC;IACnF,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,WAAI,CAAC,CAAC;QAClB,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC;QAChD,OA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3
|
+
import type { FileConfig } from './types';
|
|
4
|
+
export type ConnectionConfig = {
|
|
5
|
+
mode: 'url';
|
|
6
|
+
url: string;
|
|
7
|
+
options: RedisOptions;
|
|
8
|
+
} | {
|
|
9
|
+
mode: 'sentinel';
|
|
10
|
+
options: RedisOptions;
|
|
11
|
+
} | {
|
|
12
|
+
mode: 'options';
|
|
13
|
+
options: RedisOptions;
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveConnection({ flags, env, file, }: {
|
|
16
|
+
flags: FlagValues;
|
|
17
|
+
env: NodeJS.ProcessEnv;
|
|
18
|
+
file: FileConfig;
|
|
19
|
+
}): ConnectionConfig;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveConnection = resolveConnection;
|
|
4
|
+
const DEFAULT_REDIS_URL = 'redis://localhost:6379';
|
|
5
|
+
const DEFAULT_SENTINEL_PORT = 26379;
|
|
6
|
+
function firstDefined(...values) {
|
|
7
|
+
return values.find((value) => value !== undefined && value !== '');
|
|
8
|
+
}
|
|
9
|
+
function parseSentinel(entry) {
|
|
10
|
+
// A bare IPv6 literal is all colons, so bracket it before the URL parser sees a port.
|
|
11
|
+
const bracketed = !entry.startsWith('[') && entry.indexOf(':') !== entry.lastIndexOf(':') ? `[${entry}]` : entry;
|
|
12
|
+
let parsed;
|
|
13
|
+
try {
|
|
14
|
+
parsed = new URL(`redis://${bracketed}`);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw new Error(`Invalid sentinel address "${entry}": expected host or host:port.`);
|
|
18
|
+
}
|
|
19
|
+
const port = parsed.port === '' ? DEFAULT_SENTINEL_PORT : Number(parsed.port);
|
|
20
|
+
if (!parsed.hostname || parsed.pathname || parsed.search || port === 0) {
|
|
21
|
+
throw new Error(`Invalid sentinel address "${entry}": expected host or host:port.`);
|
|
22
|
+
}
|
|
23
|
+
return { host: parsed.hostname.replace(/^\[|\]$/g, ''), port };
|
|
24
|
+
}
|
|
25
|
+
function parseSentinels(value) {
|
|
26
|
+
return value
|
|
27
|
+
.split(',')
|
|
28
|
+
.map((entry) => entry.trim())
|
|
29
|
+
.filter(Boolean)
|
|
30
|
+
.map(parseSentinel);
|
|
31
|
+
}
|
|
32
|
+
function assertUsableUrl(url) {
|
|
33
|
+
if (url.startsWith('/'))
|
|
34
|
+
return;
|
|
35
|
+
let parsed;
|
|
36
|
+
try {
|
|
37
|
+
parsed = new URL(url);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw new Error(`Invalid Redis URL: ${url}`);
|
|
41
|
+
}
|
|
42
|
+
if (!['redis:', 'rediss:'].includes(parsed.protocol)) {
|
|
43
|
+
throw new Error(`Redis URL must use redis:// or rediss://, got "${parsed.protocol}//"`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function credentialOptions({ flags, env }) {
|
|
47
|
+
const options = {};
|
|
48
|
+
const names = [];
|
|
49
|
+
const add = (name, key, value) => {
|
|
50
|
+
if (value === undefined)
|
|
51
|
+
return;
|
|
52
|
+
options[key] = value;
|
|
53
|
+
names.push(name);
|
|
54
|
+
};
|
|
55
|
+
const db = firstDefined(flags['redis-db'], env.BULL_BOARD_REDIS_DB);
|
|
56
|
+
if (db !== undefined && (!Number.isInteger(Number(db)) || Number(db) < 0)) {
|
|
57
|
+
throw new Error(`Invalid --redis-db: ${db}`);
|
|
58
|
+
}
|
|
59
|
+
add('--sentinel-password', 'sentinelPassword', firstDefined(flags['sentinel-password'], env.BULL_BOARD_SENTINEL_PASSWORD));
|
|
60
|
+
add('--redis-username', 'username', firstDefined(flags['redis-username'], env.BULL_BOARD_REDIS_USERNAME));
|
|
61
|
+
add('--redis-password', 'password', firstDefined(flags['redis-password'], env.BULL_BOARD_REDIS_PASSWORD));
|
|
62
|
+
add('--redis-db', 'db', db === undefined ? undefined : Number(db));
|
|
63
|
+
return { options, names };
|
|
64
|
+
}
|
|
65
|
+
function resolveConnection({ flags, env, file, }) {
|
|
66
|
+
var _a;
|
|
67
|
+
const explicitUrl = firstDefined(flags.redis, env.BULL_BOARD_REDIS_URL);
|
|
68
|
+
const sentinelList = firstDefined(flags.sentinel, env.BULL_BOARD_SENTINELS);
|
|
69
|
+
const sentinelName = firstDefined(flags['sentinel-name'], env.BULL_BOARD_SENTINEL_NAME);
|
|
70
|
+
const credentials = credentialOptions({ flags, env });
|
|
71
|
+
if (sentinelList && explicitUrl) {
|
|
72
|
+
throw new Error('Use either a Redis URL or --sentinel, not both.');
|
|
73
|
+
}
|
|
74
|
+
if (sentinelList) {
|
|
75
|
+
if (!sentinelName) {
|
|
76
|
+
throw new Error('--sentinel needs --sentinel-name, the Redis master group name.');
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
mode: 'sentinel',
|
|
80
|
+
options: {
|
|
81
|
+
sentinels: parseSentinels(sentinelList),
|
|
82
|
+
name: sentinelName,
|
|
83
|
+
...credentials.options,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const fileRedis = file.redis;
|
|
88
|
+
if (!explicitUrl && typeof fileRedis === 'object') {
|
|
89
|
+
const options = { ...fileRedis, ...credentials.options };
|
|
90
|
+
return fileRedis.sentinels ? { mode: 'sentinel', options } : { mode: 'options', options };
|
|
91
|
+
}
|
|
92
|
+
const url = (_a = explicitUrl !== null && explicitUrl !== void 0 ? explicitUrl : (typeof fileRedis === 'string' ? fileRedis : undefined)) !== null && _a !== void 0 ? _a : DEFAULT_REDIS_URL;
|
|
93
|
+
assertUsableUrl(url);
|
|
94
|
+
if (credentials.names.length > 0) {
|
|
95
|
+
throw new Error(`${credentials.names.join(', ')} cannot be combined with a Redis URL. Put credentials in the URL itself, or connect through --sentinel.`);
|
|
96
|
+
}
|
|
97
|
+
return { mode: 'url', url, options: {} };
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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,OAAO,EAAE,EAAE,EAAE,CAAC;AAC3C,CAAC"}
|
package/dist/config/flags.d.ts
CHANGED
|
@@ -3,6 +3,24 @@ export declare const FLAG_OPTIONS: {
|
|
|
3
3
|
readonly type: "string";
|
|
4
4
|
readonly short: "r";
|
|
5
5
|
};
|
|
6
|
+
readonly sentinel: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
};
|
|
9
|
+
readonly 'sentinel-name': {
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
};
|
|
12
|
+
readonly 'sentinel-password': {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
};
|
|
15
|
+
readonly 'redis-username': {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
};
|
|
18
|
+
readonly 'redis-password': {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
};
|
|
21
|
+
readonly 'redis-db': {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
};
|
|
6
24
|
readonly port: {
|
|
7
25
|
readonly type: "string";
|
|
8
26
|
readonly short: "p";
|
|
@@ -34,6 +52,12 @@ export declare const FLAG_OPTIONS: {
|
|
|
34
52
|
readonly 'board-title': {
|
|
35
53
|
readonly type: "string";
|
|
36
54
|
};
|
|
55
|
+
readonly history: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
};
|
|
58
|
+
readonly 'history-retention-days': {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
};
|
|
37
61
|
readonly config: {
|
|
38
62
|
readonly type: "string";
|
|
39
63
|
};
|
|
@@ -57,6 +81,12 @@ export declare const FLAG_OPTIONS: {
|
|
|
57
81
|
};
|
|
58
82
|
export declare function parseFlags(argv: string[]): {
|
|
59
83
|
redis?: string | undefined;
|
|
84
|
+
sentinel?: string | undefined;
|
|
85
|
+
'sentinel-name'?: string | undefined;
|
|
86
|
+
'sentinel-password'?: string | undefined;
|
|
87
|
+
'redis-username'?: string | undefined;
|
|
88
|
+
'redis-password'?: string | undefined;
|
|
89
|
+
'redis-db'?: string | undefined;
|
|
60
90
|
port?: string | undefined;
|
|
61
91
|
host?: string | undefined;
|
|
62
92
|
prefix?: string | undefined;
|
|
@@ -67,6 +97,8 @@ export declare function parseFlags(argv: string[]): {
|
|
|
67
97
|
user?: string | undefined;
|
|
68
98
|
password?: string | undefined;
|
|
69
99
|
'board-title'?: string | undefined;
|
|
100
|
+
history?: boolean | undefined;
|
|
101
|
+
'history-retention-days'?: string | undefined;
|
|
70
102
|
config?: string | undefined;
|
|
71
103
|
'no-open'?: boolean | undefined;
|
|
72
104
|
'no-retry'?: boolean | undefined;
|
package/dist/config/flags.js
CHANGED
|
@@ -5,6 +5,12 @@ exports.parseFlags = parseFlags;
|
|
|
5
5
|
const node_util_1 = require("node:util");
|
|
6
6
|
exports.FLAG_OPTIONS = {
|
|
7
7
|
redis: { type: 'string', short: 'r' },
|
|
8
|
+
sentinel: { type: 'string' },
|
|
9
|
+
'sentinel-name': { type: 'string' },
|
|
10
|
+
'sentinel-password': { type: 'string' },
|
|
11
|
+
'redis-username': { type: 'string' },
|
|
12
|
+
'redis-password': { type: 'string' },
|
|
13
|
+
'redis-db': { type: 'string' },
|
|
8
14
|
port: { type: 'string', short: 'p' },
|
|
9
15
|
host: { type: 'string' },
|
|
10
16
|
prefix: { type: 'string' },
|
|
@@ -15,6 +21,8 @@ exports.FLAG_OPTIONS = {
|
|
|
15
21
|
user: { type: 'string' },
|
|
16
22
|
password: { type: 'string' },
|
|
17
23
|
'board-title': { type: 'string' },
|
|
24
|
+
history: { type: 'boolean' },
|
|
25
|
+
'history-retention-days': { type: 'string' },
|
|
18
26
|
config: { type: 'string' },
|
|
19
27
|
'no-open': { type: 'boolean' },
|
|
20
28
|
'no-retry': { type: 'boolean' },
|
package/dist/config/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/config/flags.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/config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E;IAC/B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACnB,CAAC;AAEX,SAAgB,UAAU,CAAC,IAAc;IACvC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,qBAAS,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC;IAE7F,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/config/resolve.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveConfig = resolveConfig;
|
|
4
|
+
const connection_1 = require("./connection");
|
|
4
5
|
const DEFAULTS = {
|
|
5
|
-
redisUrl: 'redis://localhost:6379',
|
|
6
6
|
port: 3000,
|
|
7
7
|
host: '127.0.0.1',
|
|
8
8
|
prefixes: ['bull'],
|
|
@@ -53,21 +53,43 @@ function resolveConfig({ flags, env, file, }) {
|
|
|
53
53
|
if (boardTitle) {
|
|
54
54
|
uiConfig.boardTitle = boardTitle;
|
|
55
55
|
}
|
|
56
|
+
const readOnly = (_c = (_b = (_a = flags['read-only']) !== null && _a !== void 0 ? _a : toBoolean(env.BULL_BOARD_READ_ONLY)) !== null && _b !== void 0 ? _b : file.readOnly) !== null && _c !== void 0 ? _c : false;
|
|
57
|
+
const history = resolveHistory({ flags, env, file, readOnly });
|
|
58
|
+
if (history) {
|
|
59
|
+
// Without showMetrics the per-queue chart never renders, so nor does its range selector.
|
|
60
|
+
uiConfig.showMetrics = (_d = uiConfig.showMetrics) !== null && _d !== void 0 ? _d : true;
|
|
61
|
+
}
|
|
56
62
|
return {
|
|
57
|
-
|
|
58
|
-
port: (
|
|
59
|
-
host: (
|
|
60
|
-
prefixes: (
|
|
61
|
-
queueNames: (
|
|
62
|
-
scanInterval: (
|
|
63
|
-
basePath: (
|
|
64
|
-
readOnly
|
|
63
|
+
connection: (0, connection_1.resolveConnection)({ flags, env, file }),
|
|
64
|
+
port: (_g = (_f = (_e = toNumber(flags.port, 'port')) !== null && _e !== void 0 ? _e : toNumber(env.BULL_BOARD_PORT, 'port')) !== null && _f !== void 0 ? _f : toNumber(file.port, 'port')) !== null && _g !== void 0 ? _g : DEFAULTS.port,
|
|
65
|
+
host: (_h = firstDefined(flags.host, env.BULL_BOARD_HOST, file.host)) !== null && _h !== void 0 ? _h : DEFAULTS.host,
|
|
66
|
+
prefixes: (_l = (_k = (_j = toList(flags.prefix)) !== null && _j !== void 0 ? _j : toList(env.BULL_BOARD_PREFIX)) !== null && _k !== void 0 ? _k : toList(file.prefix)) !== null && _l !== void 0 ? _l : DEFAULTS.prefixes,
|
|
67
|
+
queueNames: (_p = (_o = (_m = toList(flags.queues)) !== null && _m !== void 0 ? _m : toList(env.BULL_BOARD_QUEUES)) !== null && _o !== void 0 ? _o : toList(explicitQueues)) !== null && _p !== void 0 ? _p : null,
|
|
68
|
+
scanInterval: (_s = (_r = (_q = toNumber(flags['scan-interval'], 'scan-interval')) !== null && _q !== void 0 ? _q : toNumber(env.BULL_BOARD_SCAN_INTERVAL, 'scan-interval')) !== null && _r !== void 0 ? _r : toNumber(file.scanInterval, 'scan-interval')) !== null && _s !== void 0 ? _s : DEFAULTS.scanInterval,
|
|
69
|
+
basePath: (_v = (_u = (_t = normalizeBasePath(flags['base-path'])) !== null && _t !== void 0 ? _t : normalizeBasePath(env.BULL_BOARD_BASE_PATH)) !== null && _u !== void 0 ? _u : normalizeBasePath(file.basePath)) !== null && _v !== void 0 ? _v : '',
|
|
70
|
+
readOnly,
|
|
65
71
|
auth: user && password ? { user, password } : null,
|
|
66
72
|
open: flags['no-open'] === true ? false : ((_x = (_w = toBoolean(env.BULL_BOARD_OPEN)) !== null && _w !== void 0 ? _w : file.open) !== null && _x !== void 0 ? _x : true),
|
|
67
73
|
browser: firstDefined(flags.browser, env.BULL_BOARD_BROWSER, env.BROWSER, file.browser),
|
|
68
74
|
uiConfig,
|
|
69
75
|
queueOptions,
|
|
70
76
|
noRetry: (_0 = (_z = (_y = flags['no-retry']) !== null && _y !== void 0 ? _y : toBoolean(env.BULL_BOARD_NO_RETRY)) !== null && _z !== void 0 ? _z : file.noRetry) !== null && _0 !== void 0 ? _0 : false,
|
|
77
|
+
history,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function resolveHistory({ flags, env, file, readOnly, }) {
|
|
81
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
82
|
+
const fileHistory = typeof file.history === 'boolean' ? { enabled: file.history } : ((_a = file.history) !== null && _a !== void 0 ? _a : {});
|
|
83
|
+
const enabled = (_d = (_c = (_b = flags.history) !== null && _b !== void 0 ? _b : toBoolean(env.BULL_BOARD_HISTORY)) !== null && _c !== void 0 ? _c : fileHistory.enabled) !== null && _d !== void 0 ? _d : false;
|
|
84
|
+
if (!enabled)
|
|
85
|
+
return null;
|
|
86
|
+
return {
|
|
87
|
+
// Recording writes to Redis, which is what --read-only says not to do.
|
|
88
|
+
record: (_e = fileHistory.record) !== null && _e !== void 0 ? _e : !readOnly,
|
|
89
|
+
retentionDays: (_g = (_f = toNumber(flags['history-retention-days'], 'history-retention-days')) !== null && _f !== void 0 ? _f : toNumber(env.BULL_BOARD_HISTORY_RETENTION_DAYS, 'history-retention-days')) !== null && _g !== void 0 ? _g : toNumber(fileHistory.retentionDays, 'history-retention-days'),
|
|
90
|
+
retention: fileHistory.retention,
|
|
91
|
+
latency: (_h = fileHistory.latency) !== null && _h !== void 0 ? _h : true,
|
|
92
|
+
snapshotIntervalMs: fileHistory.snapshotIntervalMs,
|
|
71
93
|
};
|
|
72
94
|
}
|
|
73
95
|
//# sourceMappingURL=resolve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":";;AAgDA,
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":";;AAgDA,sCAqEC;AApHD,6CAAiD;AAIjD,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,SAAS,YAAY,CAAI,GAAG,MAA4B;IACtD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,MAAM,CAAC,KAAoC;IAClD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC5D,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC;AAED,SAAS,QAAQ,CAAC,KAAkC,EAAE,KAAa;IACjE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,CAAC,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
|
1
1
|
import type { QueueAdapterOptions, UIConfig } from '@bull-board/api/typings/app';
|
|
2
|
+
import type { Retention } from '@bull-board/metrics';
|
|
3
|
+
import type { RedisOptions } from 'ioredis';
|
|
4
|
+
import type { ConnectionConfig } from './connection';
|
|
5
|
+
export interface FileHistoryConfig {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
/** Write snapshots from this process. Defaults to true unless the board is read-only. */
|
|
8
|
+
record?: boolean;
|
|
9
|
+
retentionDays?: number;
|
|
10
|
+
retention?: Partial<Retention>;
|
|
11
|
+
latency?: boolean;
|
|
12
|
+
snapshotIntervalMs?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface HistoryConfig {
|
|
15
|
+
record: boolean;
|
|
16
|
+
retentionDays?: number;
|
|
17
|
+
retention?: Partial<Retention>;
|
|
18
|
+
latency: boolean;
|
|
19
|
+
snapshotIntervalMs?: number;
|
|
20
|
+
}
|
|
2
21
|
export interface FileConfig {
|
|
3
|
-
redis?: string;
|
|
22
|
+
redis?: string | RedisOptions;
|
|
4
23
|
port?: number;
|
|
5
24
|
host?: string;
|
|
6
25
|
prefix?: string | string[];
|
|
@@ -14,9 +33,10 @@ export interface FileConfig {
|
|
|
14
33
|
browser?: string;
|
|
15
34
|
uiConfig?: UIConfig;
|
|
16
35
|
noRetry?: boolean;
|
|
36
|
+
history?: boolean | FileHistoryConfig;
|
|
17
37
|
}
|
|
18
38
|
export interface CliConfig {
|
|
19
|
-
|
|
39
|
+
connection: ConnectionConfig;
|
|
20
40
|
port: number;
|
|
21
41
|
host: string;
|
|
22
42
|
prefixes: string[];
|
|
@@ -33,4 +53,5 @@ export interface CliConfig {
|
|
|
33
53
|
uiConfig: UIConfig;
|
|
34
54
|
queueOptions: Record<string, Partial<QueueAdapterOptions>>;
|
|
35
55
|
noRetry: boolean;
|
|
56
|
+
history: HistoryConfig | null;
|
|
36
57
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import type { ConnectionConfig } from './config/connection';
|
|
1
2
|
export declare const RETRY_INTERVAL_MS = 3000;
|
|
2
3
|
export type ConnectionState = {
|
|
3
4
|
status: 'connecting';
|
|
4
|
-
|
|
5
|
+
redis: string;
|
|
5
6
|
attempts: number;
|
|
6
7
|
} | {
|
|
7
8
|
status: 'connected';
|
|
8
|
-
|
|
9
|
+
redis: string;
|
|
9
10
|
attempts: number;
|
|
10
11
|
} | {
|
|
11
12
|
status: 'unavailable';
|
|
12
|
-
|
|
13
|
+
redis: string;
|
|
13
14
|
attempts: number;
|
|
14
15
|
lastError: string;
|
|
15
16
|
} | {
|
|
16
17
|
status: 'degraded';
|
|
17
|
-
|
|
18
|
+
redis: string;
|
|
18
19
|
attempts: number;
|
|
19
20
|
lastError: string;
|
|
20
21
|
};
|
|
22
|
+
export declare function describeConnection(connection: ConnectionConfig): string;
|
|
21
23
|
export declare function maskRedisUrl(redisUrl: string): string;
|
package/dist/connectionState.js
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RETRY_INTERVAL_MS = void 0;
|
|
4
|
+
exports.describeConnection = describeConnection;
|
|
4
5
|
exports.maskRedisUrl = maskRedisUrl;
|
|
5
6
|
exports.RETRY_INTERVAL_MS = 3000;
|
|
7
|
+
function describeConnection(connection) {
|
|
8
|
+
if (connection.mode === 'url')
|
|
9
|
+
return maskRedisUrl(connection.url);
|
|
10
|
+
const { name, sentinels, host, port, path } = connection.options;
|
|
11
|
+
if (sentinels) {
|
|
12
|
+
const addresses = sentinels
|
|
13
|
+
.map((sentinel) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const host = (_a = sentinel.host) !== null && _a !== void 0 ? _a : 'localhost';
|
|
16
|
+
return `${host.includes(':') ? `[${host}]` : host}:${(_b = sentinel.port) !== null && _b !== void 0 ? _b : 26379}`;
|
|
17
|
+
})
|
|
18
|
+
.join(',');
|
|
19
|
+
return `sentinel://${name}@${addresses}`;
|
|
20
|
+
}
|
|
21
|
+
return path !== null && path !== void 0 ? path : `redis://${host !== null && host !== void 0 ? host : 'localhost'}:${port !== null && port !== void 0 ? port : 6379}`;
|
|
22
|
+
}
|
|
6
23
|
function maskRedisUrl(redisUrl) {
|
|
7
24
|
if (redisUrl.startsWith('/'))
|
|
8
25
|
return redisUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectionState.js","sourceRoot":"","sources":["../src/connectionState.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"connectionState.js","sourceRoot":"","sources":["../src/connectionState.ts"],"names":[],"mappings":";;;AAUA,gDAiBC;AAED,oCAuBC;AAlDY,QAAA,iBAAiB,GAAG,IAAI,CAAC;AAQtC,SAAgB,kBAAkB,CAAC,UAA4B;IAC7D,IAAI,UAAU,CAAC,IAAI,KAAK,KAAK;QAAE,OAAO,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAEnE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;IACjE,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,SAAS,GAAG,SAAS;aACxB,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;;YAChB,MAAM,IAAI,GAAG,MAAA,QAAQ,CAAC,IAAI,mCAAI,WAAW,CAAC;YAE1C,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,MAAA,QAAQ,CAAC,IAAI,mCAAI,KAAK,EAAE,CAAC;QAChF,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO,cAAc,IAAI,IAAI,SAAS,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,WAAW,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,WAAW,IAAI,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,EAAE,CAAC;AAClE,CAAC;AAED,SAAgB,YAAY,CAAC,QAAgB;IAC3C,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE9C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;YACxB,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;YACvC,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACpC,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/diagnosticPage.js
CHANGED
|
@@ -119,7 +119,7 @@ function renderDiagnosticPage(state) {
|
|
|
119
119
|
<h1>bull-board is waiting for Redis</h1>
|
|
120
120
|
<p class="status">${headline}</p>
|
|
121
121
|
<dl>
|
|
122
|
-
<dt>Redis
|
|
122
|
+
<dt>Redis</dt><dd><code>${escapeHtml(state.redis)}</code></dd>
|
|
123
123
|
<dt>Error</dt><dd><code>${escapeHtml(error)}</code></dd>
|
|
124
124
|
${attemptsRow}
|
|
125
125
|
</dl>
|
|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ist/help.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HELP = "\nbull-board - run the bull-board dashboard against a Redis instance\n\nUsage:\n bull-board [options]\n npx @bull-board/cli [options]\n\nOptions:\n -r, --redis <url> Redis connection URL [redis://localhost:6379]\n -p, --port <port> Port to listen on [3000]\n --host <address> Interface to bind [127.0.0.1]\n --prefix <list> Comma separated key prefixes [bull]\n --queues <list> Use these queue names instead of discovering\n --scan-interval <s> Seconds between rescans, 0 to scan once [10]\n --base-path <path> Serve the dashboard under a path prefix\n --read-only Disable every destructive action\n --user <name> Basic auth user (requires --password)\n --password <pass> Basic auth password (requires --user)\n --board-title <s> Dashboard title\n --config <file> Path to a config file\n --browser <command> Command to open the browser with [$BROWSER]\n --no-open Do not open a browser\n --no-retry Exit if Redis is unreachable instead of retrying\n -h, --help Show this help\n -v, --version Show the version\n\nIf Redis is unreachable at startup, bull-board still opens: it serves a\ndiagnostic page explaining why, keeps retrying every 3 seconds, and switches\nto the real dashboard on its own once Redis answers. That only covers\nstartup: once the dashboard is live it stays live, even if Redis goes away\nlater. The diagnostic page does not come back; API requests just stop\nreturning until Redis is reachable again, and Ctrl-C still works.\nPass --no-retry to get the old behaviour back instead: print the error and\nexit 1 immediately, without opening a port.\n\nEnvironment variables mirror every flag, for example BULL_BOARD_REDIS_URL,\
|
|
1
|
+
export declare const HELP = "\nbull-board - run the bull-board dashboard against a Redis instance\n\nUsage:\n bull-board [options]\n npx @bull-board/cli [options]\n\nOptions:\n -r, --redis <url> Redis connection URL [redis://localhost:6379]\n --sentinel <list> Comma separated sentinel host:port list, port [26379]\n --sentinel-name <n> Redis master group name, required with --sentinel\n --sentinel-password <pass>\n Password for the sentinel nodes themselves\n --redis-username <name>\n Username for the Redis nodes behind the sentinels\n --redis-password <pass>\n Password for the Redis nodes behind the sentinels\n --redis-db <n> Database to select behind the sentinels\n -p, --port <port> Port to listen on [3000]\n --host <address> Interface to bind [127.0.0.1]\n --prefix <list> Comma separated key prefixes [bull]\n --queues <list> Use these queue names instead of discovering\n --scan-interval <s> Seconds between rescans, 0 to scan once [10]\n --base-path <path> Serve the dashboard under a path prefix\n --read-only Disable every destructive action\n --user <name> Basic auth user (requires --password)\n --password <pass> Basic auth password (requires --user)\n --board-title <s> Dashboard title\n --history Record and serve long-retention metrics history\n --history-retention-days <n>\n Days of history to keep [90]\n --config <file> Path to a config file\n --browser <command> Command to open the browser with [$BROWSER]\n --no-open Do not open a browser\n --no-retry Exit if Redis is unreachable instead of retrying\n -h, --help Show this help\n -v, --version Show the version\n\nIf Redis is unreachable at startup, bull-board still opens: it serves a\ndiagnostic page explaining why, keeps retrying every 3 seconds, and switches\nto the real dashboard on its own once Redis answers. That only covers\nstartup: once the dashboard is live it stays live, even if Redis goes away\nlater. The diagnostic page does not come back; API requests just stop\nreturning until Redis is reachable again, and Ctrl-C still works.\nPass --no-retry to get the old behaviour back instead: print the error and\nexit 1 immediately, without opening a port.\n\n--history turns on historical metrics: the dashboard gains a range selector\nper queue and a cross-queue Metrics history page, and this process records\nthroughput, latency and queue age into Redis under the bull-board:metrics:\nnamespace once a minute. --read-only stops the recording but keeps serving\nwhatever another process has recorded.\n\n--sentinel connects through Redis Sentinel instead of a URL, and the two are\nmutually exclusive. ioredis resolves the current master through the sentinels\nlisted and follows a failover on its own, so queue reads, the Bull subscriber\nand --history recording all move with it. The credential flags above apply to\nsentinel mode only; with a Redis URL, put credentials in the URL itself.\n\nEnvironment variables mirror every flag, for example BULL_BOARD_REDIS_URL,\nBULL_BOARD_SENTINELS, BULL_BOARD_SENTINEL_NAME, BULL_BOARD_PORT,\nBULL_BOARD_READ_ONLY.\n\nExamples:\n bull-board\n bull-board -r redis://localhost:6379 -p 4000\n bull-board --prefix tenant-a,tenant-b --read-only\n bull-board --user admin --password secret --host 0.0.0.0\n bull-board --sentinel s1:26379,s2:26379 --sentinel-name mymaster\n";
|
package/dist/help.js
CHANGED
|
@@ -10,6 +10,15 @@ Usage:
|
|
|
10
10
|
|
|
11
11
|
Options:
|
|
12
12
|
-r, --redis <url> Redis connection URL [redis://localhost:6379]
|
|
13
|
+
--sentinel <list> Comma separated sentinel host:port list, port [26379]
|
|
14
|
+
--sentinel-name <n> Redis master group name, required with --sentinel
|
|
15
|
+
--sentinel-password <pass>
|
|
16
|
+
Password for the sentinel nodes themselves
|
|
17
|
+
--redis-username <name>
|
|
18
|
+
Username for the Redis nodes behind the sentinels
|
|
19
|
+
--redis-password <pass>
|
|
20
|
+
Password for the Redis nodes behind the sentinels
|
|
21
|
+
--redis-db <n> Database to select behind the sentinels
|
|
13
22
|
-p, --port <port> Port to listen on [3000]
|
|
14
23
|
--host <address> Interface to bind [127.0.0.1]
|
|
15
24
|
--prefix <list> Comma separated key prefixes [bull]
|
|
@@ -20,6 +29,9 @@ Options:
|
|
|
20
29
|
--user <name> Basic auth user (requires --password)
|
|
21
30
|
--password <pass> Basic auth password (requires --user)
|
|
22
31
|
--board-title <s> Dashboard title
|
|
32
|
+
--history Record and serve long-retention metrics history
|
|
33
|
+
--history-retention-days <n>
|
|
34
|
+
Days of history to keep [90]
|
|
23
35
|
--config <file> Path to a config file
|
|
24
36
|
--browser <command> Command to open the browser with [$BROWSER]
|
|
25
37
|
--no-open Do not open a browser
|
|
@@ -36,13 +48,27 @@ returning until Redis is reachable again, and Ctrl-C still works.
|
|
|
36
48
|
Pass --no-retry to get the old behaviour back instead: print the error and
|
|
37
49
|
exit 1 immediately, without opening a port.
|
|
38
50
|
|
|
51
|
+
--history turns on historical metrics: the dashboard gains a range selector
|
|
52
|
+
per queue and a cross-queue Metrics history page, and this process records
|
|
53
|
+
throughput, latency and queue age into Redis under the bull-board:metrics:
|
|
54
|
+
namespace once a minute. --read-only stops the recording but keeps serving
|
|
55
|
+
whatever another process has recorded.
|
|
56
|
+
|
|
57
|
+
--sentinel connects through Redis Sentinel instead of a URL, and the two are
|
|
58
|
+
mutually exclusive. ioredis resolves the current master through the sentinels
|
|
59
|
+
listed and follows a failover on its own, so queue reads, the Bull subscriber
|
|
60
|
+
and --history recording all move with it. The credential flags above apply to
|
|
61
|
+
sentinel mode only; with a Redis URL, put credentials in the URL itself.
|
|
62
|
+
|
|
39
63
|
Environment variables mirror every flag, for example BULL_BOARD_REDIS_URL,
|
|
40
|
-
BULL_BOARD_PORT,
|
|
64
|
+
BULL_BOARD_SENTINELS, BULL_BOARD_SENTINEL_NAME, BULL_BOARD_PORT,
|
|
65
|
+
BULL_BOARD_READ_ONLY.
|
|
41
66
|
|
|
42
67
|
Examples:
|
|
43
68
|
bull-board
|
|
44
69
|
bull-board -r redis://localhost:6379 -p 4000
|
|
45
70
|
bull-board --prefix tenant-a,tenant-b --read-only
|
|
46
71
|
bull-board --user admin --password secret --host 0.0.0.0
|
|
72
|
+
bull-board --sentinel s1:26379,s2:26379 --sentinel-name mymaster
|
|
47
73
|
`;
|
|
48
74
|
//# sourceMappingURL=help.js.map
|
package/dist/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BaseAdapter } from '@bull-board/api/baseAdapter';
|
|
2
|
+
import type { MetricsHistoryProvider } from '@bull-board/api/typings/app';
|
|
3
|
+
import type { Redis } from 'ioredis';
|
|
4
|
+
import type { HistoryConfig } from './config/types';
|
|
5
|
+
export interface HistoryRuntime {
|
|
6
|
+
provider: MetricsHistoryProvider;
|
|
7
|
+
start(queues: () => BaseAdapter[]): void;
|
|
8
|
+
stop(): void;
|
|
9
|
+
}
|
|
10
|
+
export interface HistoryDeps {
|
|
11
|
+
client: Redis;
|
|
12
|
+
config: HistoryConfig;
|
|
13
|
+
onWarning(message: string): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createHistory({ client, config, onWarning }: HistoryDeps): HistoryRuntime;
|
|
16
|
+
export declare function warnIfCountersUnavailable(queues: BaseAdapter[], onWarning: (message: string) => void): Promise<void>;
|
package/dist/history.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHistory = createHistory;
|
|
4
|
+
exports.warnIfCountersUnavailable = warnIfCountersUnavailable;
|
|
5
|
+
const metrics_1 = require("@bull-board/metrics");
|
|
6
|
+
const describeError_1 = require("./describeError");
|
|
7
|
+
function createHistory({ client, config, onWarning }) {
|
|
8
|
+
const retentionWindow = { retentionDays: config.retentionDays, retention: config.retention };
|
|
9
|
+
const provider = new metrics_1.RedisMetricsHistoryProvider({ connection: client, ...retentionWindow });
|
|
10
|
+
let recorder = null;
|
|
11
|
+
return {
|
|
12
|
+
provider,
|
|
13
|
+
start(queues) {
|
|
14
|
+
if (!config.record || recorder)
|
|
15
|
+
return;
|
|
16
|
+
recorder = new metrics_1.MetricsRecorder({
|
|
17
|
+
queues,
|
|
18
|
+
connection: client,
|
|
19
|
+
...retentionWindow,
|
|
20
|
+
latency: config.latency,
|
|
21
|
+
snapshotIntervalMs: config.snapshotIntervalMs,
|
|
22
|
+
onLatencyError: (error, queueName) => onWarning(`Latency sampling failed for "${queueName}": ${(0, describeError_1.describeError)(error)}`),
|
|
23
|
+
});
|
|
24
|
+
recorder.start();
|
|
25
|
+
},
|
|
26
|
+
stop() {
|
|
27
|
+
recorder === null || recorder === void 0 ? void 0 : recorder.stop();
|
|
28
|
+
recorder = null;
|
|
29
|
+
provider.disconnect();
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function warnIfCountersUnavailable(queues, onWarning) {
|
|
34
|
+
if (queues.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
const populated = await Promise.all(queues.map((queue) => queue
|
|
37
|
+
.getMetrics('completed')
|
|
38
|
+
.then((metrics) => { var _a, _b; return ((_b = (_a = metrics === null || metrics === void 0 ? void 0 : metrics.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0; })
|
|
39
|
+
.catch(() => false)));
|
|
40
|
+
if (populated.some(Boolean))
|
|
41
|
+
return;
|
|
42
|
+
onWarning('No BullMQ metrics data found on any queue. Completed and failed history stays empty ' +
|
|
43
|
+
'until your workers are created with metrics: { maxDataPoints: MetricsTime.ONE_WEEK }. ' +
|
|
44
|
+
'Latency and queue age are recorded either way.');
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":";;AAmBA,sCA2BC;AAED,8DAqBC;AAnED,iDAAmF;AAGnF,mDAAgD;AAchD,SAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAe;IACtE,MAAM,eAAe,GAAG,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7F,MAAM,QAAQ,GAAG,IAAI,qCAA2B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAAC,CAAC;IAC7F,IAAI,QAAQ,GAA2B,IAAI,CAAC;IAE5C,OAAO;QACL,QAAQ;QACR,KAAK,CAAC,MAAM;YACV,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,QAAQ;gBAAE,OAAO;YAEvC,QAAQ,GAAG,IAAI,yBAAe,CAAC;gBAC7B,MAAM;gBACN,UAAU,EAAE,MAAM;gBAClB,GAAG,eAAe;gBAClB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;gBAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CACnC,SAAS,CAAC,gCAAgC,SAAS,MAAM,IAAA,6BAAa,EAAC,KAAc,CAAC,EAAE,CAAC;aAC5F,CAAC,CAAC;YACH,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;QACD,IAAI;YACF,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAC;YACjB,QAAQ,GAAG,IAAI,CAAC;YAChB,QAAQ,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,yBAAyB,CAC7C,MAAqB,EACrB,SAAoC;IAEpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEhC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnB,KAAK;SACF,UAAU,CAAC,WAAW,CAAC;SACvB,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,eAAC,OAAA,CAAC,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC;SACnD,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CACtB,CACF,CAAC;IACF,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO;IAEpC,SAAS,CACP,sFAAsF;QACpF,wFAAwF;QACxF,gDAAgD,CACnD,CAAC;AACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const connectionState_1 = require("./connectionState");
|
|
|
9
9
|
const describeError_1 = require("./describeError");
|
|
10
10
|
Object.defineProperty(exports, "describeError", { enumerable: true, get: function () { return describeError_1.describeError; } });
|
|
11
11
|
const discovery_1 = require("./discovery");
|
|
12
|
+
const history_1 = require("./history");
|
|
12
13
|
const queueFactory_1 = require("./queueFactory");
|
|
13
14
|
const registry_1 = require("./registry");
|
|
14
15
|
const server_1 = require("./server");
|
|
@@ -36,28 +37,45 @@ async function closeWithGrace(promise, ms, onTimeout) {
|
|
|
36
37
|
onTimeout();
|
|
37
38
|
}
|
|
38
39
|
async function run(config, log = console, { beforeReady, } = {}) {
|
|
39
|
-
const
|
|
40
|
+
const redisOptions = {
|
|
40
41
|
maxRetriesPerRequest: null,
|
|
41
42
|
lazyConnect: true,
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
// ioredis retries unreachable sentinels forever, so connect() never rejects and --no-retry
|
|
44
|
+
// would hang. The retrying path keeps ioredis's own backoff, which re-resolves a promoted
|
|
45
|
+
// master faster than a flat interval would.
|
|
46
|
+
...(config.noRetry
|
|
47
|
+
? { sentinelRetryStrategy: () => null }
|
|
48
|
+
: { retryStrategy: () => connectionState_1.RETRY_INTERVAL_MS }),
|
|
49
|
+
...config.connection.options,
|
|
50
|
+
};
|
|
51
|
+
const client = config.connection.mode === 'url'
|
|
52
|
+
? new ioredis_1.Redis(config.connection.url, redisOptions)
|
|
53
|
+
: new ioredis_1.Redis(redisOptions);
|
|
54
|
+
const redisLabel = (0, connectionState_1.describeConnection)(config.connection);
|
|
44
55
|
let attemptError;
|
|
45
56
|
client.on('error', (error) => {
|
|
46
57
|
attemptError !== null && attemptError !== void 0 ? attemptError : (attemptError = error);
|
|
47
58
|
});
|
|
59
|
+
// For the same reason, the first error rather than connect() is what releases startup onto
|
|
60
|
+
// the diagnostic page.
|
|
61
|
+
const firstError = new Promise((_, reject) => client.once('error', reject));
|
|
62
|
+
firstError.catch(() => undefined);
|
|
48
63
|
if (!isLoopbackHost(config.host) && !config.auth) {
|
|
49
64
|
log.warn(`Warning: bull-board is listening on ${config.host}, which accepts connections from ` +
|
|
50
65
|
'outside this machine, with no --user/--password set. Anyone who can reach it can ' +
|
|
51
66
|
'view and modify every queue. Set --user and --password, or bind to 127.0.0.1.');
|
|
52
67
|
}
|
|
68
|
+
const onWarning = (message) => log.warn(message);
|
|
69
|
+
const history = config.history
|
|
70
|
+
? (0, history_1.createHistory)({ client, config: config.history, onWarning })
|
|
71
|
+
: null;
|
|
53
72
|
const serverAdapter = new express_1.ExpressAdapter();
|
|
54
73
|
serverAdapter.setBasePath(config.basePath);
|
|
55
74
|
const board = (0, api_1.createBullBoard)({
|
|
56
75
|
queues: [],
|
|
57
76
|
serverAdapter,
|
|
58
|
-
options: { uiConfig: config.uiConfig },
|
|
77
|
+
options: { uiConfig: config.uiConfig, historyProvider: history === null || history === void 0 ? void 0 : history.provider },
|
|
59
78
|
});
|
|
60
|
-
const onWarning = (message) => log.warn(message);
|
|
61
79
|
const queues = (0, queueFactory_1.createQueueFactory)({
|
|
62
80
|
client,
|
|
63
81
|
readOnly: config.readOnly,
|
|
@@ -76,6 +94,19 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
76
94
|
await registry.sync(discovered);
|
|
77
95
|
return discovered.length;
|
|
78
96
|
};
|
|
97
|
+
const startHistory = async () => {
|
|
98
|
+
var _a;
|
|
99
|
+
if (!history)
|
|
100
|
+
return;
|
|
101
|
+
history.start(() => registry.adapters());
|
|
102
|
+
if ((_a = config.history) === null || _a === void 0 ? void 0 : _a.record) {
|
|
103
|
+
await (0, history_1.warnIfCountersUnavailable)(registry.adapters(), onWarning);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
log.warn('Historical metrics are served read-only: this process records nothing, so the charts ' +
|
|
107
|
+
'show only what another process has already recorded.');
|
|
108
|
+
}
|
|
109
|
+
};
|
|
79
110
|
const logIfIdle = (count) => {
|
|
80
111
|
if (count === 0) {
|
|
81
112
|
log.log(`No queues found under ${config.prefixes.join(', ')} yet. ` +
|
|
@@ -98,12 +129,14 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
98
129
|
await client.connect();
|
|
99
130
|
}
|
|
100
131
|
catch (error) {
|
|
101
|
-
throw new Error(`Could not connect to Redis at ${
|
|
132
|
+
throw new Error(`Could not connect to Redis at ${redisLabel}: ${(0, describeError_1.describeError)(attemptError !== null && attemptError !== void 0 ? attemptError : error)}`);
|
|
102
133
|
}
|
|
103
134
|
const count = await scan();
|
|
135
|
+
await startHistory();
|
|
104
136
|
const server = await (0, server_1.startServer)(config, { serverAdapter });
|
|
105
137
|
const close = async () => {
|
|
106
138
|
closing = true;
|
|
139
|
+
history === null || history === void 0 ? void 0 : history.stop();
|
|
107
140
|
if (rescanTimer)
|
|
108
141
|
clearTimeout(rescanTimer);
|
|
109
142
|
await closeWithGrace(server.close(), SHUTDOWN_GRACE_MS, () => {
|
|
@@ -116,7 +149,7 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
116
149
|
};
|
|
117
150
|
beforeReady === null || beforeReady === void 0 ? void 0 : beforeReady(close);
|
|
118
151
|
log.log(`bull-board listening on ${server.url}`);
|
|
119
|
-
log.log(`Redis: ${
|
|
152
|
+
log.log(`Redis: ${redisLabel}`);
|
|
120
153
|
log.log(`Prefix: ${config.prefixes.join(', ')}`);
|
|
121
154
|
logIfIdle(count);
|
|
122
155
|
scheduleRescan();
|
|
@@ -124,13 +157,14 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
124
157
|
}
|
|
125
158
|
let state = {
|
|
126
159
|
status: 'connecting',
|
|
127
|
-
|
|
160
|
+
redis: redisLabel,
|
|
128
161
|
attempts: 0,
|
|
129
162
|
};
|
|
130
163
|
const getState = () => state;
|
|
131
164
|
const server = await (0, server_1.startServer)(config, { serverAdapter, getConnectionState: getState });
|
|
132
165
|
const close = async () => {
|
|
133
166
|
closing = true;
|
|
167
|
+
history === null || history === void 0 ? void 0 : history.stop();
|
|
134
168
|
if (rescanTimer)
|
|
135
169
|
clearTimeout(rescanTimer);
|
|
136
170
|
await closeWithGrace(server.close(), SHUTDOWN_GRACE_MS, () => {
|
|
@@ -156,13 +190,13 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
156
190
|
}
|
|
157
191
|
state = {
|
|
158
192
|
status: 'unavailable',
|
|
159
|
-
|
|
193
|
+
redis: redisLabel,
|
|
160
194
|
attempts: state.attempts + 1,
|
|
161
195
|
lastError: message,
|
|
162
196
|
};
|
|
163
197
|
if (!everFailed) {
|
|
164
198
|
everFailed = true;
|
|
165
|
-
log.warn(`Could not connect to Redis at ${
|
|
199
|
+
log.warn(`Could not connect to Redis at ${redisLabel}: ${message}`);
|
|
166
200
|
log.warn(`Serving a diagnostic page at ${server.url} and retrying every ` +
|
|
167
201
|
`${connectionState_1.RETRY_INTERVAL_MS / 1000}s. Pass --no-retry to exit instead of waiting.`);
|
|
168
202
|
}
|
|
@@ -181,10 +215,11 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
181
215
|
return;
|
|
182
216
|
state = {
|
|
183
217
|
status: 'connected',
|
|
184
|
-
|
|
218
|
+
redis: redisLabel,
|
|
185
219
|
attempts: state.attempts,
|
|
186
220
|
};
|
|
187
221
|
scheduleRescan();
|
|
222
|
+
await startHistory();
|
|
188
223
|
if (everFailed)
|
|
189
224
|
log.log('Redis connected. The dashboard is live.');
|
|
190
225
|
if (deferIdleLog) {
|
|
@@ -200,7 +235,7 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
200
235
|
const message = error.message;
|
|
201
236
|
state = {
|
|
202
237
|
status: 'degraded',
|
|
203
|
-
|
|
238
|
+
redis: redisLabel,
|
|
204
239
|
attempts: state.attempts,
|
|
205
240
|
lastError: message,
|
|
206
241
|
};
|
|
@@ -213,7 +248,9 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
213
248
|
return inFlight;
|
|
214
249
|
};
|
|
215
250
|
try {
|
|
216
|
-
|
|
251
|
+
const connecting = client.connect();
|
|
252
|
+
connecting.catch(() => undefined);
|
|
253
|
+
await Promise.race([connecting, firstError]);
|
|
217
254
|
}
|
|
218
255
|
catch (error) {
|
|
219
256
|
markUnavailable((0, describeError_1.describeError)(attemptError !== null && attemptError !== void 0 ? attemptError : error));
|
|
@@ -222,7 +259,7 @@ async function run(config, log = console, { beforeReady, } = {}) {
|
|
|
222
259
|
await becomeConnected(true);
|
|
223
260
|
}
|
|
224
261
|
log.log(`bull-board listening on ${server.url}`);
|
|
225
|
-
log.log(`Redis: ${
|
|
262
|
+
log.log(`Redis: ${redisLabel}`);
|
|
226
263
|
log.log(`Prefix: ${config.prefixes.join(', ')}`);
|
|
227
264
|
if (deferredIdleCount !== undefined)
|
|
228
265
|
logIfIdle(deferredIdleCount);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAsDA,kBAuSC;AA7VD,yCAAkD;AAClD,iDAAqD;AACrD,qCAAgC;AAEhC,uDAAgG;AAChG,mDAAgD;AAOvC,8FAPA,6BAAa,OAOA;AANtB,2CAA0D;AAC1D,uCAAqE;AACrE,iDAAoD;AACpD,yCAA2C;AAC3C,qCAAuC;AASvC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AAElE,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B,SAAS,WAAW,CAAC,EAAU;IAC7B,IAAI,KAAqB,CAAC;IAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;QACjD,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QACjD,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;I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AU,CAAC,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAe,CAAC,IAAA,6BAAa,EAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAK,KAAe,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC9B,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,GAAG,CAAC,GAAG,CAAC,2BAA2B,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;IACjD,GAAG,CAAC,GAAG,CAAC,WAAW,UAAU,EAAE,CAAC,CAAC;IACjC,GAAG,CAAC,GAAG,CAAC,WAAW,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,IAAI,iBAAiB,KAAK,SAAS;QAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAElE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACtB,cAAc,GAAG,KAAK,CAAC;QACvB,KAAK,eAAe,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;QAClC,eAAe,CAAC,IAAA,6BAAa,EAAC,KAAK,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC"}
|
package/dist/registry.d.ts
CHANGED
package/dist/registry.js
CHANGED
|
@@ -7,6 +7,9 @@ class QueueRegistry {
|
|
|
7
7
|
this.deps = deps;
|
|
8
8
|
this.live = new Map();
|
|
9
9
|
}
|
|
10
|
+
adapters() {
|
|
11
|
+
return [...this.live.values()].map((handle) => handle.adapter);
|
|
12
|
+
}
|
|
10
13
|
async sync(discovered) {
|
|
11
14
|
// The board keys queues by bare name, so the same name under two prefixes would displace
|
|
12
15
|
// itself. First prefix wins.
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":";;;AAmBA,MAAM,KAAK,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;AAE1E,MAAa,aAAa;IAGxB,YAA6B,IAAuB;QAAvB,SAAI,GAAJ,IAAI,CAAmB;QAFnC,SAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEA,CAAC;IAEjD,KAAK,CAAC,IAAI,CAAC,UAA6B;QAC7C,yFAAyF;QACzF,6BAA6B;QAC7B,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,GAAG,EAA2B,CAAC;QAElD,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;YAC/B,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,SAAS,CACjB,aAAa,KAAK,CAAC,IAAI,mBAAmB,KAAK,CAAC,MAAM,gCAAgC;oBACpF,6BAA6B,CAChC,CAAC;gBACF,SAAS;YACX,CAAC;YACD,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;QAClC,CAAC;QAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;YAClC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,SAAS;YAEjC,IAAI,MAAmB,CAAC;YACxB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC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CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACzF,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAElF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,wCAAwC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAlED,sCAkEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bull-board/cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.8.0",
|
|
4
4
|
"description": "Run the bull-board dashboard against a Redis instance from the command line.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bull",
|
|
@@ -38,8 +38,9 @@
|
|
|
38
38
|
"test": "jest"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@bull-board/api": "9.
|
|
42
|
-
"@bull-board/express": "9.
|
|
41
|
+
"@bull-board/api": "9.8.0",
|
|
42
|
+
"@bull-board/express": "9.8.0",
|
|
43
|
+
"@bull-board/metrics": "9.8.0",
|
|
43
44
|
"bull": "^4.16.5",
|
|
44
45
|
"bullmq": "^5.81.3",
|
|
45
46
|
"express": "^5.2.1",
|
|
@@ -48,8 +49,10 @@
|
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@types/express": "^5.0.6",
|
|
50
51
|
"@types/jest": "^30.0.0",
|
|
52
|
+
"@types/redis-parser": "^3.0.3",
|
|
51
53
|
"@types/supertest": "^7.2.1",
|
|
52
54
|
"jest": "^30.4.2",
|
|
55
|
+
"redis-parser": "^3.0.0",
|
|
53
56
|
"supertest": "^7.2.2",
|
|
54
57
|
"ts-jest": "^29.4.12",
|
|
55
58
|
"typescript": "^5.9.3"
|