pg-boss 12.5.3 → 12.6.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/dist/attorney.d.ts.map +1 -1
- package/dist/attorney.js +57 -0
- package/dist/bam.d.ts +14 -0
- package/dist/bam.d.ts.map +1 -0
- package/dist/bam.js +114 -0
- package/dist/boss.d.ts.map +1 -1
- package/dist/boss.js +18 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -1
- package/dist/manager.d.ts +3 -1
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +230 -50
- package/dist/migrationStore.d.ts.map +1 -1
- package/dist/migrationStore.js +302 -3
- package/dist/plans.d.ts +21 -2
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +376 -63
- package/dist/types.d.ts +73 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -9
package/dist/attorney.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attorney.d.ts","sourceRoot":"","sources":["../src/attorney.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,QAAA,MAAM,MAAM;;;;CAIX,CAAA;AAMD,iBAAS,iBAAiB,CAAE,MAAM,GAAE,GAAQ,QAW3C;AAED,iBAAS,aAAa,CAAE,IAAI,EAAE,GAAG,GAAG,KAAK,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"attorney.d.ts","sourceRoot":"","sources":["../src/attorney.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAExC,QAAA,MAAM,MAAM;;;;CAIX,CAAA;AAMD,iBAAS,iBAAiB,CAAE,MAAM,GAAE,GAAQ,QAW3C;AAED,iBAAS,aAAa,CAAE,IAAI,EAAE,GAAG,GAAG,KAAK,CAAC,OAAO,CA+ChD;AAmED,iBAAS,aAAa,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG;IAClD,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAA;IAClC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;CACjC,CA2BA;AAED,iBAAS,cAAc,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAOlD;AAED,iBAAS,SAAS,CAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,0BAA0B,CAoB9F;AAkBD,iBAAS,wBAAwB,CAAE,IAAI,EAAE,MAAM,QAK9C;AAED,iBAAS,eAAe,CAAE,IAAI,EAAE,MAAM,QAIrC;AAED,iBAAS,SAAS,CAAE,GAAG,EAAE,MAAM,QAI9B;AA+FD,OAAO,EACL,SAAS,EACT,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,MAAM,EACN,iBAAiB,EAClB,CAAA"}
|
package/dist/attorney.js
CHANGED
|
@@ -51,8 +51,57 @@ function checkSendArgs(args) {
|
|
|
51
51
|
validateExpirationConfig(options);
|
|
52
52
|
validateRetentionConfig(options);
|
|
53
53
|
validateDeletionConfig(options);
|
|
54
|
+
validateGroupConfig(options);
|
|
54
55
|
return { name, data, options };
|
|
55
56
|
}
|
|
57
|
+
function validateGroupConfig(config) {
|
|
58
|
+
if (!('group' in config) || config.group === undefined || config.group === null) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
assert(typeof config.group === 'object', 'group must be an object');
|
|
62
|
+
assert(typeof config.group.id === 'string' && config.group.id.length > 0, 'group.id must be a non-empty string');
|
|
63
|
+
assert(!('tier' in config.group) || (typeof config.group.tier === 'string' && config.group.tier.length > 0), 'group.tier must be a non-empty string if provided');
|
|
64
|
+
}
|
|
65
|
+
function validateGroupConcurrencyValue(value, optionName) {
|
|
66
|
+
if (typeof value === 'number') {
|
|
67
|
+
assert(Number.isInteger(value) && value >= 1, `${optionName} must be an integer >= 1`);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
assert(typeof value === 'object', `${optionName} must be a number or an object with { default, tiers? }`);
|
|
71
|
+
assert(Number.isInteger(value.default) && value.default >= 1, `${optionName}.default must be an integer >= 1`);
|
|
72
|
+
if ('tiers' in value && value.tiers) {
|
|
73
|
+
assert(typeof value.tiers === 'object', `${optionName}.tiers must be an object`);
|
|
74
|
+
for (const [tier, limit] of Object.entries(value.tiers)) {
|
|
75
|
+
assert(typeof tier === 'string' && tier.length > 0, `${optionName} tier keys must be non-empty strings`);
|
|
76
|
+
assert(Number.isInteger(limit) && limit >= 1, `${optionName}.tiers["${tier}"] must be an integer >= 1`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function validateGroupConcurrencyConfig(config) {
|
|
81
|
+
const hasGlobal = config.groupConcurrency != null;
|
|
82
|
+
const hasLocal = config.localGroupConcurrency != null;
|
|
83
|
+
assert(!(hasGlobal && hasLocal), 'cannot specify both groupConcurrency and localGroupConcurrency - choose one');
|
|
84
|
+
if (hasGlobal)
|
|
85
|
+
validateGroupConcurrencyValue(config.groupConcurrency, 'groupConcurrency');
|
|
86
|
+
if (hasLocal) {
|
|
87
|
+
validateGroupConcurrencyValue(config.localGroupConcurrency, 'localGroupConcurrency');
|
|
88
|
+
validateLocalGroupConcurrencyLimit(config.localGroupConcurrency, config.localConcurrency);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function validateLocalGroupConcurrencyLimit(localGroupConcurrency, localConcurrency) {
|
|
92
|
+
const effectiveLocalConcurrency = localConcurrency ?? 1;
|
|
93
|
+
if (typeof localGroupConcurrency === 'number') {
|
|
94
|
+
assert(localGroupConcurrency <= effectiveLocalConcurrency, `localGroupConcurrency (${localGroupConcurrency}) cannot exceed localConcurrency (${effectiveLocalConcurrency})`);
|
|
95
|
+
}
|
|
96
|
+
else if (typeof localGroupConcurrency === 'object') {
|
|
97
|
+
assert(localGroupConcurrency.default <= effectiveLocalConcurrency, `localGroupConcurrency.default (${localGroupConcurrency.default}) cannot exceed localConcurrency (${effectiveLocalConcurrency})`);
|
|
98
|
+
if (localGroupConcurrency.tiers) {
|
|
99
|
+
for (const [tier, limit] of Object.entries(localGroupConcurrency.tiers)) {
|
|
100
|
+
assert(limit <= effectiveLocalConcurrency, `localGroupConcurrency.tiers["${tier}"] (${limit}) cannot exceed localConcurrency (${effectiveLocalConcurrency})`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
56
105
|
function checkWorkArgs(name, args) {
|
|
57
106
|
let options, callback;
|
|
58
107
|
assert(name, 'queue name is required');
|
|
@@ -71,6 +120,8 @@ function checkWorkArgs(name, args) {
|
|
|
71
120
|
assert(!('batchSize' in options) || (Number.isInteger(options.batchSize) && options.batchSize >= 1), 'batchSize must be an integer > 0');
|
|
72
121
|
assert(!('includeMetadata' in options) || typeof options.includeMetadata === 'boolean', 'includeMetadata must be a boolean');
|
|
73
122
|
assert(!('priority' in options) || typeof options.priority === 'boolean', 'priority must be a boolean');
|
|
123
|
+
assert(!('localConcurrency' in options) || (Number.isInteger(options.localConcurrency) && options.localConcurrency >= 1), 'localConcurrency must be an integer >= 1');
|
|
124
|
+
validateGroupConcurrencyConfig(options);
|
|
74
125
|
return { options, callback };
|
|
75
126
|
}
|
|
76
127
|
function checkFetchArgs(name, options) {
|
|
@@ -92,6 +143,7 @@ function getConfig(value) {
|
|
|
92
143
|
applySchemaConfig(config);
|
|
93
144
|
applyOpsConfig(config);
|
|
94
145
|
applyScheduleConfig(config);
|
|
146
|
+
applyBamConfig(config);
|
|
95
147
|
validateWarningConfig(config);
|
|
96
148
|
return config;
|
|
97
149
|
}
|
|
@@ -167,4 +219,9 @@ function applyScheduleConfig(config) {
|
|
|
167
219
|
assert(!('cronWorkerIntervalSeconds' in config) || (config.cronWorkerIntervalSeconds >= 1 && config.cronWorkerIntervalSeconds <= 45), 'configuration assert: cronWorkerIntervalSeconds must be between 1 and 45 seconds');
|
|
168
220
|
config.cronWorkerIntervalSeconds = config.cronWorkerIntervalSeconds || 5;
|
|
169
221
|
}
|
|
222
|
+
function applyBamConfig(config) {
|
|
223
|
+
const minInterval = config.__test__bypass_bam_interval_check ? 1 : 10;
|
|
224
|
+
assert(!('bamIntervalSeconds' in config) || config.bamIntervalSeconds >= minInterval, `configuration assert: bamIntervalSeconds must be at least ${minInterval} seconds`);
|
|
225
|
+
config.bamIntervalSeconds = config.bamIntervalSeconds || 60;
|
|
226
|
+
}
|
|
170
227
|
export { assertKey, assertPostgresObjectName, assertQueueName, checkFetchArgs, checkSendArgs, checkWorkArgs, getConfig, POLICY, validateQueueArgs };
|
package/dist/bam.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import EventEmitter from 'node:events';
|
|
2
|
+
import * as types from './types.js';
|
|
3
|
+
declare class Bam extends EventEmitter implements types.EventsMixin {
|
|
4
|
+
#private;
|
|
5
|
+
events: {
|
|
6
|
+
error: string;
|
|
7
|
+
bam: string;
|
|
8
|
+
};
|
|
9
|
+
constructor(db: types.IDatabase, config: types.ResolvedConstructorOptions);
|
|
10
|
+
start(): Promise<void>;
|
|
11
|
+
stop(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export default Bam;
|
|
14
|
+
//# sourceMappingURL=bam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bam.d.ts","sourceRoot":"","sources":["../src/bam.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AAEtC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAOnC,cAAM,GAAI,SAAQ,YAAa,YAAW,KAAK,CAAC,WAAW;;IAOzD,MAAM;;;MAAS;gBAGb,EAAE,EAAE,KAAK,CAAC,SAAS,EACnB,MAAM,EAAE,KAAK,CAAC,0BAA0B;IAUpC,KAAK;IAWL,IAAI;CAgGX;AAED,eAAe,GAAG,CAAA"}
|
package/dist/bam.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import EventEmitter from 'node:events';
|
|
2
|
+
import * as plans from './plans.js';
|
|
3
|
+
import * as types from './types.js';
|
|
4
|
+
const events = {
|
|
5
|
+
error: 'error',
|
|
6
|
+
bam: 'bam'
|
|
7
|
+
};
|
|
8
|
+
class Bam extends EventEmitter {
|
|
9
|
+
#stopped;
|
|
10
|
+
#working;
|
|
11
|
+
#pollInterval;
|
|
12
|
+
#db;
|
|
13
|
+
#config;
|
|
14
|
+
events = events;
|
|
15
|
+
constructor(db, config) {
|
|
16
|
+
super();
|
|
17
|
+
this.#db = db;
|
|
18
|
+
this.#config = config;
|
|
19
|
+
this.#stopped = true;
|
|
20
|
+
this.#working = false;
|
|
21
|
+
}
|
|
22
|
+
async start() {
|
|
23
|
+
if (!this.#stopped)
|
|
24
|
+
return;
|
|
25
|
+
this.#stopped = false;
|
|
26
|
+
setImmediate(() => this.#onPoll());
|
|
27
|
+
this.#pollInterval = setInterval(() => this.#onPoll(), this.#config.bamIntervalSeconds * 1000);
|
|
28
|
+
}
|
|
29
|
+
async stop() {
|
|
30
|
+
if (this.#stopped)
|
|
31
|
+
return;
|
|
32
|
+
this.#stopped = true;
|
|
33
|
+
if (this.#pollInterval) {
|
|
34
|
+
clearInterval(this.#pollInterval);
|
|
35
|
+
this.#pollInterval = undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async #onPoll() {
|
|
39
|
+
if (this.#stopped || this.#working || !this.#config.migrate)
|
|
40
|
+
return;
|
|
41
|
+
this.#working = true;
|
|
42
|
+
try {
|
|
43
|
+
if (this.#config.__test__throw_bam) {
|
|
44
|
+
throw new Error(this.#config.__test__throw_bam);
|
|
45
|
+
}
|
|
46
|
+
const sql = plans.trySetBamTime(this.#config.schema, this.#config.bamIntervalSeconds);
|
|
47
|
+
const { rows } = await this.#db.executeSql(sql);
|
|
48
|
+
if (rows.length === 1) {
|
|
49
|
+
await this.#processCommands();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.emit(events.error, err);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
this.#working = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async #processCommands() {
|
|
60
|
+
if (this.#stopped)
|
|
61
|
+
return;
|
|
62
|
+
const entry = await this.#getNextCommand();
|
|
63
|
+
if (!entry || this.#stopped)
|
|
64
|
+
return;
|
|
65
|
+
this.emit(events.bam, {
|
|
66
|
+
id: entry.id,
|
|
67
|
+
name: entry.name,
|
|
68
|
+
status: 'in_progress',
|
|
69
|
+
queue: entry.queue,
|
|
70
|
+
table: entry.table
|
|
71
|
+
});
|
|
72
|
+
try {
|
|
73
|
+
await this.#db.executeSql(entry.command);
|
|
74
|
+
if (this.#stopped)
|
|
75
|
+
return;
|
|
76
|
+
await this.#markCompleted(entry.id);
|
|
77
|
+
this.emit(events.bam, {
|
|
78
|
+
id: entry.id,
|
|
79
|
+
name: entry.name,
|
|
80
|
+
status: 'completed',
|
|
81
|
+
queue: entry.queue,
|
|
82
|
+
table: entry.table
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
if (this.#stopped)
|
|
87
|
+
return;
|
|
88
|
+
await this.#markFailed(entry.id, err);
|
|
89
|
+
this.emit(events.error, err);
|
|
90
|
+
this.emit(events.bam, {
|
|
91
|
+
id: entry.id,
|
|
92
|
+
name: entry.name,
|
|
93
|
+
status: 'failed',
|
|
94
|
+
queue: entry.queue,
|
|
95
|
+
table: entry.table,
|
|
96
|
+
error: String(err)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async #getNextCommand() {
|
|
101
|
+
const sql = plans.getNextBamCommand(this.#config.schema);
|
|
102
|
+
const { rows } = await this.#db.executeSql(sql);
|
|
103
|
+
return rows[0] || null;
|
|
104
|
+
}
|
|
105
|
+
async #markCompleted(id) {
|
|
106
|
+
const sql = plans.setBamCompleted(this.#config.schema, id);
|
|
107
|
+
await this.#db.executeSql(sql);
|
|
108
|
+
}
|
|
109
|
+
async #markFailed(id, error) {
|
|
110
|
+
const sql = plans.setBamFailed(this.#config.schema, id, String(error));
|
|
111
|
+
await this.#db.executeSql(sql);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export default Bam;
|
package/dist/boss.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boss.d.ts","sourceRoot":"","sources":["../src/boss.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAYnC,cAAM,IAAK,SAAQ,YAAa,YAAW,KAAK,CAAC,WAAW;;
|
|
1
|
+
{"version":3,"file":"boss.d.ts","sourceRoot":"","sources":["../src/boss.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAYnC,cAAM,IAAK,SAAQ,YAAa,YAAW,KAAK,CAAC,WAAW;;IAS1D,MAAM;;;MAAS;gBAGb,EAAE,EAAE,KAAK,CAAC,SAAS,EACnB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,CAAC,0BAA0B;IAmBpC,KAAK;IAWL,IAAI;IAkEJ,SAAS,CAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,EAAE;CAuFtD;AAED,eAAe,IAAI,CAAA"}
|
package/dist/boss.js
CHANGED
|
@@ -12,6 +12,7 @@ const WARNINGS = {
|
|
|
12
12
|
};
|
|
13
13
|
class Boss extends EventEmitter {
|
|
14
14
|
#stopped;
|
|
15
|
+
#stopping;
|
|
15
16
|
#maintaining;
|
|
16
17
|
#superviseInterval;
|
|
17
18
|
#db;
|
|
@@ -24,6 +25,7 @@ class Boss extends EventEmitter {
|
|
|
24
25
|
this.#config = config;
|
|
25
26
|
this.#manager = manager;
|
|
26
27
|
this.#stopped = true;
|
|
28
|
+
this.#stopping = false;
|
|
27
29
|
if (config.warningSlowQuerySeconds) {
|
|
28
30
|
WARNINGS.SLOW_QUERY.seconds = config.warningSlowQuerySeconds;
|
|
29
31
|
}
|
|
@@ -33,12 +35,14 @@ class Boss extends EventEmitter {
|
|
|
33
35
|
}
|
|
34
36
|
async start() {
|
|
35
37
|
if (this.#stopped) {
|
|
38
|
+
this.#stopping = false;
|
|
36
39
|
this.#superviseInterval = setInterval(() => this.#onSupervise(), this.#config.superviseIntervalSeconds * 1000);
|
|
37
40
|
this.#stopped = false;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
async stop() {
|
|
41
44
|
if (!this.#stopped) {
|
|
45
|
+
this.#stopping = true;
|
|
42
46
|
if (this.#superviseInterval)
|
|
43
47
|
clearInterval(this.#superviseInterval);
|
|
44
48
|
this.#stopped = true;
|
|
@@ -105,9 +109,13 @@ class Boss extends EventEmitter {
|
|
|
105
109
|
return acc;
|
|
106
110
|
}, {});
|
|
107
111
|
for (const queueGroup of Object.values(queueGroups)) {
|
|
112
|
+
if (this.#stopping)
|
|
113
|
+
return;
|
|
108
114
|
const { table, queues } = queueGroup;
|
|
109
115
|
const names = queues.map((i) => i.name);
|
|
110
116
|
while (names.length) {
|
|
117
|
+
if (this.#stopping)
|
|
118
|
+
return;
|
|
111
119
|
const chunk = names.splice(0, 100);
|
|
112
120
|
await this.#monitor(table, chunk);
|
|
113
121
|
await this.#maintain(table, chunk);
|
|
@@ -115,12 +123,18 @@ class Boss extends EventEmitter {
|
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
async #monitor(table, names) {
|
|
126
|
+
if (this.#stopping)
|
|
127
|
+
return;
|
|
118
128
|
const command = plans.trySetQueueMonitorTime(this.#config.schema, names, this.#config.monitorIntervalSeconds);
|
|
119
129
|
const { rows } = await this.#executeQuery(command);
|
|
130
|
+
if (this.#stopping)
|
|
131
|
+
return;
|
|
120
132
|
if (rows.length) {
|
|
121
133
|
const queues = rows.map((q) => q.name);
|
|
122
134
|
const cacheStatsSql = plans.cacheQueueStats(this.#config.schema, table, queues);
|
|
123
135
|
const { rows: rowsCacheStats } = await this.#executeSql(cacheStatsSql);
|
|
136
|
+
if (this.#stopping)
|
|
137
|
+
return;
|
|
124
138
|
const warnings = rowsCacheStats.filter(i => i.queuedCount > (i.warningQueueSize || WARNINGS.LARGE_QUEUE.size));
|
|
125
139
|
for (const warning of warnings) {
|
|
126
140
|
this.emit(events.warning, {
|
|
@@ -133,8 +147,12 @@ class Boss extends EventEmitter {
|
|
|
133
147
|
}
|
|
134
148
|
}
|
|
135
149
|
async #maintain(table, names) {
|
|
150
|
+
if (this.#stopping)
|
|
151
|
+
return;
|
|
136
152
|
const command = plans.trySetQueueDeletionTime(this.#config.schema, names, this.#config.maintenanceIntervalSeconds);
|
|
137
153
|
const { rows } = await this.#executeQuery(command);
|
|
154
|
+
if (this.#stopping)
|
|
155
|
+
return;
|
|
138
156
|
if (rows.length) {
|
|
139
157
|
const queues = rows.map((q) => q.name);
|
|
140
158
|
const sql = plans.deletion(this.#config.schema, table, queues);
|
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,11 @@ export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
|
44
44
|
deleteAllJobs(name?: string): Promise<void>;
|
|
45
45
|
complete(name: string, id: string | string[], data?: object | null, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
46
46
|
fail(name: string, id: string | string[], data?: object | null, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use findJobs() instead
|
|
49
|
+
*/
|
|
47
50
|
getJobById<T>(name: string, id: string, options?: types.ConnectionOptions): Promise<types.JobWithMetadata<T> | null>;
|
|
51
|
+
findJobs<T>(name: string, options?: types.FindJobsOptions): Promise<types.JobWithMetadata<T>[]>;
|
|
48
52
|
createQueue(name: string, options?: Omit<types.Queue, 'name'>): Promise<void>;
|
|
49
53
|
updateQueue(name: string, options?: types.UpdateQueueOptions): Promise<void>;
|
|
50
54
|
deleteQueue(name: string): Promise<void>;
|
|
@@ -59,8 +63,10 @@ export declare class PgBoss extends EventEmitter<types.PgBossEventMap> {
|
|
|
59
63
|
schedule(name: string, cron: string, data?: object | null, options?: types.ScheduleOptions): Promise<void>;
|
|
60
64
|
unschedule(name: string, key?: string): Promise<void>;
|
|
61
65
|
getSchedules(name?: string, key?: string): Promise<types.Schedule[]>;
|
|
66
|
+
getBamStatus(): Promise<types.BamStatusSummary[]>;
|
|
67
|
+
getBamEntries(): Promise<types.BamEntry[]>;
|
|
62
68
|
getDb(): types.IDatabase;
|
|
63
69
|
}
|
|
64
|
-
export type { ConnectionOptions, ConstructorOptions, FetchOptions, IDatabase as Db, InsertOptions, Job, JobFetchOptions, JobInsert, JobPollingOptions, JobStates, Events, JobWithMetadata, MaintenanceOptions, OffWorkOptions, Queue, QueuePolicy, QueueResult, Request, Schedule, ScheduleOptions, SchedulingOptions, SendOptions, StopOptions, WipData, WorkHandler, WorkOptions, WorkWithMetadataHandler, } from './types.ts';
|
|
70
|
+
export type { BamEntry, BamEvent, BamStatusSummary, ConnectionOptions, ConstructorOptions, FetchOptions, FindJobsOptions, IDatabase as Db, InsertOptions, Job, JobFetchOptions, JobInsert, JobPollingOptions, JobStates, Events, JobWithMetadata, MaintenanceOptions, OffWorkOptions, Queue, QueueOptions, QueuePolicy, QueueResult, Request, Schedule, ScheduleOptions, SchedulingOptions, SendOptions, StopOptions, WipData, WorkHandler, WorkOptions, WorkWithMetadataHandler, } from './types.ts';
|
|
65
71
|
export type { JobSpyInterface, JobSpyState, JobDataSelector, JobSelector, SpyJob, } from './spy.ts';
|
|
66
72
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,aAAa,CAAA;AAQtC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAA;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AACvD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,MAMzB,CAAA;AAEF,wBAAgB,oBAAoB,CAAE,MAAM,CAAC,EAAE,MAAM,UAEpD;AAED,wBAAgB,iBAAiB,CAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAEnE;AAED,wBAAgB,gBAAgB,CAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAElE;AAED,qBAAa,MAAO,SAAQ,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC;;gBAa/C,gBAAgB,EAAE,MAAM;gBACxB,OAAO,EAAE,KAAK,CAAC,kBAAkB;IA6CxC,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAsCvB,IAAI,CAAE,OAAO,GAAE,KAAK,CAAC,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4C3D,IAAI,CAAE,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IACrD,IAAI,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,KAAK,C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ACX,uBAAuB,GACxB,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,EACf,WAAW,EACX,MAAM,GACP,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,9 @@ import Contractor from "./contractor.js";
|
|
|
4
4
|
import Manager from "./manager.js";
|
|
5
5
|
import Timekeeper from "./timekeeper.js";
|
|
6
6
|
import Boss from "./boss.js";
|
|
7
|
+
import Bam from "./bam.js";
|
|
7
8
|
import { delay } from "./tools.js";
|
|
9
|
+
import * as plans from "./plans.js";
|
|
8
10
|
import DbDefault from "./db.js";
|
|
9
11
|
export { JOB_STATES as states } from "./plans.js";
|
|
10
12
|
export { QUEUE_POLICIES as policies } from "./plans.js";
|
|
@@ -12,7 +14,8 @@ export const events = Object.freeze({
|
|
|
12
14
|
error: 'error',
|
|
13
15
|
warning: 'warning',
|
|
14
16
|
wip: 'wip',
|
|
15
|
-
stopped: 'stopped'
|
|
17
|
+
stopped: 'stopped',
|
|
18
|
+
bam: 'bam'
|
|
16
19
|
});
|
|
17
20
|
export function getConstructionPlans(schema) {
|
|
18
21
|
return Contractor.constructionPlans(schema);
|
|
@@ -34,6 +37,7 @@ export class PgBoss extends EventEmitter {
|
|
|
34
37
|
#contractor;
|
|
35
38
|
#manager;
|
|
36
39
|
#timekeeper;
|
|
40
|
+
#bam;
|
|
37
41
|
constructor(value) {
|
|
38
42
|
super();
|
|
39
43
|
this.#stoppingOn = null;
|
|
@@ -50,13 +54,16 @@ export class PgBoss extends EventEmitter {
|
|
|
50
54
|
const boss = new Boss(db, manager, config);
|
|
51
55
|
const timekeeper = new Timekeeper(db, manager, config);
|
|
52
56
|
manager.timekeeper = timekeeper;
|
|
57
|
+
const bam = new Bam(db, config);
|
|
53
58
|
this.#promoteEvents(manager);
|
|
54
59
|
this.#promoteEvents(boss);
|
|
55
60
|
this.#promoteEvents(timekeeper);
|
|
61
|
+
this.#promoteEvents(bam);
|
|
56
62
|
this.#boss = boss;
|
|
57
63
|
this.#contractor = contractor;
|
|
58
64
|
this.#manager = manager;
|
|
59
65
|
this.#timekeeper = timekeeper;
|
|
66
|
+
this.#bam = bam;
|
|
60
67
|
}
|
|
61
68
|
#promoteEvents(emitter) {
|
|
62
69
|
for (const event of Object.values(emitter?.events)) {
|
|
@@ -84,6 +91,9 @@ export class PgBoss extends EventEmitter {
|
|
|
84
91
|
if (this.#config.schedule) {
|
|
85
92
|
await this.#timekeeper.start();
|
|
86
93
|
}
|
|
94
|
+
if (this.#config.migrate) {
|
|
95
|
+
await this.#bam.start();
|
|
96
|
+
}
|
|
87
97
|
this.#starting = false;
|
|
88
98
|
this.#started = true;
|
|
89
99
|
this.#stopped = false;
|
|
@@ -99,6 +109,7 @@ export class PgBoss extends EventEmitter {
|
|
|
99
109
|
await this.#manager.stop();
|
|
100
110
|
await this.#timekeeper.stop();
|
|
101
111
|
await this.#boss.stop();
|
|
112
|
+
await this.#bam.stop();
|
|
102
113
|
const shutdown = async () => {
|
|
103
114
|
await this.#manager.failWip();
|
|
104
115
|
if (this.#db._pgbdb && this.#db.opened && close) {
|
|
@@ -182,9 +193,15 @@ export class PgBoss extends EventEmitter {
|
|
|
182
193
|
fail(name, id, data, options) {
|
|
183
194
|
return this.#manager.fail(name, id, data, options);
|
|
184
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated Use findJobs() instead
|
|
198
|
+
*/
|
|
185
199
|
getJobById(name, id, options) {
|
|
186
200
|
return this.#manager.getJobById(name, id, options);
|
|
187
201
|
}
|
|
202
|
+
findJobs(name, options) {
|
|
203
|
+
return this.#manager.findJobs(name, options);
|
|
204
|
+
}
|
|
188
205
|
createQueue(name, options) {
|
|
189
206
|
return this.#manager.createQueue(name, options);
|
|
190
207
|
}
|
|
@@ -227,6 +244,16 @@ export class PgBoss extends EventEmitter {
|
|
|
227
244
|
getSchedules(name, key) {
|
|
228
245
|
return this.#timekeeper.getSchedules(name, key);
|
|
229
246
|
}
|
|
247
|
+
async getBamStatus() {
|
|
248
|
+
const sql = plans.getBamStatus(this.#config.schema);
|
|
249
|
+
const { rows } = await this.#db.executeSql(sql);
|
|
250
|
+
return rows;
|
|
251
|
+
}
|
|
252
|
+
async getBamEntries() {
|
|
253
|
+
const sql = plans.getBamEntries(this.#config.schema);
|
|
254
|
+
const { rows } = await this.#db.executeSql(sql);
|
|
255
|
+
return rows;
|
|
256
|
+
}
|
|
230
257
|
getDb() {
|
|
231
258
|
if (this.#db) {
|
|
232
259
|
return this.#db;
|
package/dist/manager.d.ts
CHANGED
|
@@ -67,9 +67,10 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
67
67
|
private mapCommandResponse;
|
|
68
68
|
complete(name: string, id: string | string[], data?: object | null, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
69
69
|
fail(name: string, id: string | string[], data?: any, options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
70
|
-
cancel(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
71
70
|
deleteJob(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
71
|
+
cancel(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
72
72
|
resume(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
73
|
+
restore(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<void>;
|
|
73
74
|
retry(name: string, id: string | string[], options?: types.ConnectionOptions): Promise<types.CommandResponse>;
|
|
74
75
|
createQueue(name: string, options?: Omit<types.Queue, 'name'> & {
|
|
75
76
|
name?: string;
|
|
@@ -83,6 +84,7 @@ declare class Manager extends EventEmitter implements types.EventsMixin {
|
|
|
83
84
|
deleteAllJobs(name?: string): Promise<void>;
|
|
84
85
|
getQueueStats(name: string): Promise<any>;
|
|
85
86
|
getJobById<T>(name: string, id: string, options?: types.ConnectionOptions): Promise<types.JobWithMetadata<T> | null>;
|
|
87
|
+
findJobs<T>(name: string, options?: types.FindJobsOptions): Promise<types.JobWithMetadata<T>[]>;
|
|
86
88
|
private assertDb;
|
|
87
89
|
}
|
|
88
90
|
export default Manager;
|
package/dist/manager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,aAAa,CAAA;AAGtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AASvD,cAAM,OAAQ,SAAQ,YAAa,YAAW,KAAK,CAAC,WAAW;;IAC7D,MAAM;;;MAAS;IACf,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG;QAAE,MAAM,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,GAAG,EAAE,CAAA;IAC/C,MAAM,EAAE,KAAK,CAAC,0BAA0B,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,kBAAkB,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAA;IAC9C,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;IAChD,sBAAsB,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,aAAa,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