@imqueue/job 2.0.4 → 2.0.6
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/index.d.ts +34 -7
- package/index.js +4 -3
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -38,19 +38,32 @@ export interface JobQueueOptions {
|
|
|
38
38
|
* Connection params of the queue engine cluster (typically -
|
|
39
39
|
* host and port). By default the broker is redis.
|
|
40
40
|
* Optional.
|
|
41
|
-
* By default is [{ host: "localhost", port: 6379 }].
|
|
42
41
|
*
|
|
42
|
+
* @default [{ host: "localhost", port: 6379 }]
|
|
43
43
|
* @type {Array<{host: string, port: number}>}
|
|
44
44
|
*/
|
|
45
45
|
cluster?: {
|
|
46
46
|
host: string;
|
|
47
47
|
port: number;
|
|
48
48
|
}[];
|
|
49
|
+
/**
|
|
50
|
+
* Message queue username
|
|
51
|
+
*
|
|
52
|
+
* @type {string}
|
|
53
|
+
*/
|
|
54
|
+
username?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Message queue password
|
|
57
|
+
*
|
|
58
|
+
* @type {string}
|
|
59
|
+
*/
|
|
60
|
+
password?: string;
|
|
49
61
|
/**
|
|
50
62
|
* Logger to be used for producing log and error messages.
|
|
51
63
|
* Optional.
|
|
52
64
|
* By default is console.
|
|
53
65
|
*
|
|
66
|
+
* @default console
|
|
54
67
|
* @type {ILogger}
|
|
55
68
|
*/
|
|
56
69
|
logger?: ILogger;
|
|
@@ -60,8 +73,8 @@ export interface JobQueueOptions {
|
|
|
60
73
|
* fails or dies - job data is re-queued for future processing by another
|
|
61
74
|
* worker.
|
|
62
75
|
* Optional.
|
|
63
|
-
* Default is true.
|
|
64
76
|
*
|
|
77
|
+
* @default true
|
|
65
78
|
* @type {boolean}
|
|
66
79
|
*/
|
|
67
80
|
safe?: boolean;
|
|
@@ -70,21 +83,35 @@ export interface JobQueueOptions {
|
|
|
70
83
|
* If worker does not finish processing after this TTL - job is re-queued
|
|
71
84
|
* for other workers to be processed.
|
|
72
85
|
* Optional.
|
|
73
|
-
*
|
|
86
|
+
*
|
|
87
|
+
* @default 10000
|
|
88
|
+
* @type {number}
|
|
74
89
|
*/
|
|
75
90
|
safeLockTtl?: number;
|
|
76
91
|
/**
|
|
77
92
|
* Job queue prefix in queue broker.
|
|
78
93
|
* Optional.
|
|
79
|
-
*
|
|
94
|
+
*
|
|
95
|
+
* @default "imq-job"
|
|
96
|
+
* @type {string}
|
|
80
97
|
*/
|
|
81
98
|
prefix?: string;
|
|
82
99
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
100
|
+
* Enables/disables verbose logging
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
* @type {boolean}
|
|
86
104
|
*/
|
|
87
105
|
verbose?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Enables/disables extended verbose logging. The output may contain
|
|
108
|
+
* sensitive information, so use it with caution. Does not work if a verbose
|
|
109
|
+
* option is disabled.
|
|
110
|
+
*
|
|
111
|
+
* @default false
|
|
112
|
+
* @type {boolean}
|
|
113
|
+
*/
|
|
114
|
+
verboseExtended?: boolean;
|
|
88
115
|
}
|
|
89
116
|
export interface JobQueuePopHandler<T> {
|
|
90
117
|
/**
|
package/index.js
CHANGED
|
@@ -80,15 +80,16 @@ exports.BaseJobQueue = BaseJobQueue;
|
|
|
80
80
|
function toIMQOptions(options, logger) {
|
|
81
81
|
return {
|
|
82
82
|
cluster: options.cluster,
|
|
83
|
+
username: options.username,
|
|
84
|
+
password: options.password,
|
|
83
85
|
cleanup: false,
|
|
84
86
|
safeDelivery: typeof options.safe === 'undefined'
|
|
85
87
|
? true : options.safe,
|
|
86
88
|
safeDeliveryTtl: typeof options.safeLockTtl === 'undefined'
|
|
87
89
|
? 10000 : options.safeLockTtl,
|
|
88
90
|
prefix: options.prefix || 'imq-job',
|
|
89
|
-
verbose:
|
|
90
|
-
|
|
91
|
-
: options.verbose,
|
|
91
|
+
verbose: options.verbose,
|
|
92
|
+
verboseExtended: options.verboseExtended,
|
|
92
93
|
logger,
|
|
93
94
|
};
|
|
94
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imqueue/job",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "Simple job queue",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"message-queue",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"author": "imqueue.com <support@imqueue.com> (https://imqueue.com)",
|
|
37
37
|
"license": "GPL-3.0-only",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@imqueue/core": "^2.0.
|
|
39
|
+
"@imqueue/core": "^2.0.18"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/chai": "^5.2.2",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|
|
46
46
|
"@types/mock-require": "^3.0.0",
|
|
47
|
-
"@types/node": "^24.
|
|
47
|
+
"@types/node": "^24.9.2",
|
|
48
48
|
"@types/sinon": "^17.0.4",
|
|
49
49
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
50
50
|
"@typescript-eslint/parser": "^8.43.0",
|