@veloxts/queue 0.7.5 → 0.7.7
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/utils.d.ts +4 -9
- package/dist/utils.js +3 -19
- package/package.json +3 -3
package/dist/utils.d.ts
CHANGED
|
@@ -41,12 +41,7 @@ export declare function validateJobName(name: string): void;
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function sleep(ms: number): Promise<void>;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
backoff: {
|
|
49
|
-
type: 'fixed' | 'exponential';
|
|
50
|
-
delay: number;
|
|
51
|
-
};
|
|
52
|
-
}): Promise<T>;
|
|
44
|
+
* Re-export withRetry from @veloxts/core.
|
|
45
|
+
* @deprecated Import from '@veloxts/core' instead.
|
|
46
|
+
*/
|
|
47
|
+
export { withRetry } from '@veloxts/core';
|
package/dist/utils.js
CHANGED
|
@@ -97,23 +97,7 @@ export function sleep(ms) {
|
|
|
97
97
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* Re-export withRetry from @veloxts/core.
|
|
101
|
+
* @deprecated Import from '@veloxts/core' instead.
|
|
101
102
|
*/
|
|
102
|
-
export
|
|
103
|
-
let lastError;
|
|
104
|
-
for (let attempt = 1; attempt <= options.attempts; attempt++) {
|
|
105
|
-
try {
|
|
106
|
-
return await fn();
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
lastError = error instanceof Error ? error : new Error(String(error));
|
|
110
|
-
if (attempt < options.attempts) {
|
|
111
|
-
const delay = options.backoff.type === 'exponential'
|
|
112
|
-
? options.backoff.delay * 2 ** (attempt - 1)
|
|
113
|
-
: options.backoff.delay;
|
|
114
|
-
await sleep(delay);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
throw lastError;
|
|
119
|
-
}
|
|
103
|
+
export { withRetry } from '@veloxts/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/queue",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
4
4
|
"description": "Background job processing for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ioredis": "5.9.2",
|
|
28
28
|
"superjson": "2.2.6",
|
|
29
29
|
"zod": "4.3.6",
|
|
30
|
-
"@veloxts/core": "0.7.
|
|
30
|
+
"@veloxts/core": "0.7.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@biomejs/biome": "2.3.15",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"fastify": "5.7.4",
|
|
37
37
|
"typescript": "5.9.3",
|
|
38
38
|
"vitest": "4.0.18",
|
|
39
|
-
"@veloxts/testing": "0.7.
|
|
39
|
+
"@veloxts/testing": "0.7.7"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"fastify": "^5.7.4"
|