@lowerdeck/queue 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "@lowerdeck/queue",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
+ "files": [
8
+ "src/**",
9
+ "dist/**",
10
+ "README.md",
11
+ "package.json"
12
+ ],
7
13
  "author": "Tobias Herber",
8
14
  "license": "Apache 2",
9
15
  "type": "module",
@@ -21,20 +27,20 @@
21
27
  "scripts": {
22
28
  "test": "vitest run --passWithNoTests",
23
29
  "lint": "prettier src/**/*.ts --check",
24
- "build": "microbundle"
30
+ "build": "rm -rf ./dist && microbundle"
25
31
  },
26
32
  "dependencies": {
27
- "@lowerdeck/delay": "^1.0.3",
28
- "@lowerdeck/execution-context": "^1.0.1",
29
- "@lowerdeck/id": "^1.0.4",
30
- "@lowerdeck/memo": "^1.0.3",
31
- "@lowerdeck/redis": "^1.0.2",
32
- "@lowerdeck/sentry": "^1.0.1",
33
+ "@lowerdeck/delay": "^1.0.4",
34
+ "@lowerdeck/execution-context": "^1.0.2",
35
+ "@lowerdeck/id": "^1.0.5",
36
+ "@lowerdeck/memo": "^1.0.4",
37
+ "@lowerdeck/redis": "^1.0.3",
38
+ "@lowerdeck/sentry": "^1.0.2",
33
39
  "bullmq": "^5.66.0",
34
40
  "superjson": "^2.2.6"
35
41
  },
36
42
  "devDependencies": {
37
- "@lowerdeck/tsconfig": "^1.0.0",
43
+ "@lowerdeck/tsconfig": "^1.0.1",
38
44
  "typescript": "5.8.2",
39
45
  "microbundle": "^0.15.1",
40
46
  "vitest": "^3.1.2"
@@ -54,8 +54,13 @@ export let createBullMqQueue = <JobData>(
54
54
  connection: redisOpts,
55
55
  defaultJobOptions: {
56
56
  removeOnComplete: true,
57
- removeOnFail: true,
58
- attempts: 10,
57
+ removeOnFail: {
58
+ age: 60 * 60 * 24 // 1 day
59
+ },
60
+ backoff: {
61
+ type: 'custom'
62
+ },
63
+ attempts: 25,
59
64
  keepLogs: 10,
60
65
  ...opts.jobOpts
61
66
  }
@@ -196,7 +201,21 @@ export let createBullMqQueue = <JobData>(
196
201
  {
197
202
  concurrency: 50,
198
203
  ...opts.workerOpts,
199
- connection: redisOpts
204
+ connection: redisOpts,
205
+
206
+ settings: {
207
+ ...opts.workerOpts?.settings,
208
+
209
+ backoffStrategy: (attemptsMade: number) => {
210
+ let baseDelay = 1000;
211
+ let maxDelay = 1000 * 60 * 10; // 10 minutes
212
+
213
+ let delay = baseDelay * Math.pow(2, attemptsMade - 1);
214
+ if (delay > maxDelay) delay = maxDelay;
215
+
216
+ return delay;
217
+ }
218
+ }
200
219
  }
201
220
  );
202
221
 
@@ -1,27 +0,0 @@
1
-
2
- $ microbundle
3
- Failed to resolve the module async_hooks imported by ../execution-context/dist/index.module.js
4
- Is the module installed? Note:
5
- ↳ to inline a module into your bundle, install it to "devDependencies".
6
- ↳ to depend on a module via import/require, install it to "dependencies".
7
- Failed to resolve the module async_hooks imported by ../execution-context/dist/index.module.js
8
- Is the module installed? Note:
9
- ↳ to inline a module into your bundle, install it to "devDependencies".
10
- ↳ to depend on a module via import/require, install it to "dependencies".
11
- Failed to resolve the module async_hooks imported by ../execution-context/dist/index.module.js
12
- Is the module installed? Note:
13
- ↳ to inline a module into your bundle, install it to "devDependencies".
14
- ↳ to depend on a module via import/require, install it to "dependencies".
15
- No name was provided for external module '@lowerdeck/delay' in output.globals – guessing 'delay'
16
- No name was provided for external module 'async_hooks' in output.globals – guessing 'async_hooks'
17
- No name was provided for external module '@lowerdeck/memo' in output.globals – guessing 'memo'
18
- No name was provided for external module '@lowerdeck/redis' in output.globals – guessing 'redis'
19
- Build "@lowerdeck/queue" to dist:
20
- 66.2 kB: index.cjs.gz
21
- 57.1 kB: index.cjs.br
22
- 65.8 kB: index.module.js.gz
23
- 56.7 kB: index.module.js.br
24
- 66.2 kB: index.module.js.gz
25
- 57.2 kB: index.module.js.br
26
- 66.3 kB: index.umd.js.gz
27
- 57.2 kB: index.umd.js.br
@@ -1,11 +0,0 @@
1
-
2
- $ vitest run --passWithNoTests
3
- [?25l
4
-  RUN  v3.2.4 /Users/tobias/code/metorial/metorial-enterprise/oss/src/packages/backend/queue
5
-
6
- No test files found, exiting with code 0
7
-
8
- include: **/*.{test,spec}.?(c|m)[jt]s?(x)
9
- exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
10
-
11
- [?25h
package/CHANGELOG.md DELETED
@@ -1,27 +0,0 @@
1
- # @lowerdeck/queue
2
-
3
- ## 1.0.3
4
-
5
- ### Patch Changes
6
-
7
- - add sentry and execution context
8
-
9
- ## 1.0.2
10
-
11
- ### Patch Changes
12
-
13
- - Fix default entry point
14
- - Updated dependencies
15
- - @lowerdeck/delay@1.0.3
16
- - @lowerdeck/redis@1.0.2
17
- - @lowerdeck/memo@1.0.3
18
-
19
- ## 1.0.1
20
-
21
- ### Patch Changes
22
-
23
- - update versions
24
- - Updated dependencies
25
- - @lowerdeck/delay@1.0.2
26
- - @lowerdeck/redis@1.0.1
27
- - @lowerdeck/memo@1.0.2
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@lowerdeck/tsconfig/base.json",
4
- "exclude": ["dist"],
5
- "include": ["src"],
6
- "compilerOptions": {
7
- "outDir": "dist",
8
- "lib": ["es2021"],
9
- "target": "ES2019"
10
- }
11
- }