@ultimat3/jobs 4.0.0 → 4.1.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/package.json +5 -5
- package/src/driver-nats.ts +6 -3
- package/src/driver-redis.ts +6 -3
- package/src/errors.ts +2 -2
- package/src/inspect.ts +1 -1
- package/src/outbox.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/jobs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Durable background work: steps, transactional outbox, cron tasks, one driver interface",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"test": "bun test"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ultimat3/core": "4.
|
|
36
|
-
"@ultimat3/entity": "4.
|
|
37
|
-
"@ultimat3/schema": "4.
|
|
38
|
-
"@ultimat3/time": "4.
|
|
35
|
+
"@ultimat3/core": "4.1.0",
|
|
36
|
+
"@ultimat3/entity": "4.1.0",
|
|
37
|
+
"@ultimat3/schema": "4.1.0",
|
|
38
|
+
"@ultimat3/time": "4.1.0"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/driver-nats.ts
CHANGED
|
@@ -16,10 +16,13 @@ import type {
|
|
|
16
16
|
import { JobsNotImplementedError } from './errors';
|
|
17
17
|
import type { StepRecord, StepStore } from './steps';
|
|
18
18
|
|
|
19
|
-
// Names the
|
|
20
|
-
//
|
|
19
|
+
// Names the seam that actually replaces the stub, plus the runnable command for whatever is
|
|
20
|
+
// already queued. NOT `jobs: { driver }` in app.config.ts, which this line said until 2026-08-20:
|
|
21
|
+
// `JobsConfig.driver` has no reader anywhere (see `driver.ts`'s header), so that edit repairs
|
|
22
|
+
// nothing and the reader is sent back to the same throw. #223 removes the field.
|
|
23
|
+
// The nats driver lands in v2; there is no flag that turns this one on.
|
|
21
24
|
const FIX =
|
|
22
|
-
|
|
25
|
+
'call setJobDriver(createPgDriver()) at boot instead of this driver, then move what is already queued: x jobs drain --to memory --json';
|
|
23
26
|
|
|
24
27
|
const unavailable = (method: string): never => {
|
|
25
28
|
throw new JobsNotImplementedError({ feature: `nats jobs driver (${method})`, fix: FIX });
|
package/src/driver-redis.ts
CHANGED
|
@@ -19,10 +19,13 @@ import type {
|
|
|
19
19
|
import { JobsNotImplementedError } from './errors';
|
|
20
20
|
import type { StepRecord, StepStore } from './steps';
|
|
21
21
|
|
|
22
|
-
// Names the
|
|
23
|
-
//
|
|
22
|
+
// Names the seam that actually replaces the stub, plus the runnable command for whatever is
|
|
23
|
+
// already queued. NOT `jobs: { driver }` in app.config.ts, which this line said until 2026-08-20:
|
|
24
|
+
// `JobsConfig.driver` has no reader anywhere (see `driver.ts`'s header), so that edit repairs
|
|
25
|
+
// nothing and the reader is sent back to the same throw. #223 removes the field.
|
|
26
|
+
// The redis driver lands in v2; there is no flag that turns this one on.
|
|
24
27
|
const FIX =
|
|
25
|
-
|
|
28
|
+
'call setJobDriver(createPgDriver()) at boot instead of this driver, then move what is already queued: x jobs drain --to memory --json';
|
|
26
29
|
|
|
27
30
|
const unavailable = (method: string): never => {
|
|
28
31
|
throw new JobsNotImplementedError({ feature: `redis jobs driver (${method})`, fix: FIX });
|
package/src/errors.ts
CHANGED
|
@@ -355,7 +355,7 @@ export class CancelUnsupportedError extends UltimateError {
|
|
|
355
355
|
super({
|
|
356
356
|
code: 'X_JOB_NOT_CANCELLABLE',
|
|
357
357
|
cause: `the "${input.driver}" jobs driver cannot cancel a single job`,
|
|
358
|
-
fix:
|
|
358
|
+
fix: 'call setJobDriver(createPgDriver()) at boot — only the pg driver implements introspect.cancel — then: x jobs cancel <id> --json',
|
|
359
359
|
docs: docsFor('X_JOB_NOT_CANCELLABLE'),
|
|
360
360
|
});
|
|
361
361
|
}
|
|
@@ -372,7 +372,7 @@ export class ConcurrencyUnenforceableError extends UltimateError {
|
|
|
372
372
|
super({
|
|
373
373
|
code: 'X_JOB_CONCURRENCY_UNENFORCEABLE',
|
|
374
374
|
cause: `${input.jobs.join(', ')} declare concurrency and the "${input.driver}" jobs driver has no lease store, so the cap would hold per process and the fleet would run concurrency x replicas`,
|
|
375
|
-
fix: `remove concurrency from job("${input.jobs[0] ?? 'the job'}"), or
|
|
375
|
+
fix: `remove concurrency from job("${input.jobs[0] ?? 'the job'}"), or call setJobDriver(createPgDriver()) at boot — the pg driver is the one with a lease store`,
|
|
376
376
|
docs: docsFor('X_JOB_CONCURRENCY_UNENFORCEABLE'),
|
|
377
377
|
});
|
|
378
378
|
}
|
package/src/inspect.ts
CHANGED
|
@@ -91,7 +91,7 @@ function requireIntrospection(driver: JobDriver): NonNullable<JobDriver['introsp
|
|
|
91
91
|
if (driver.introspect === undefined) {
|
|
92
92
|
throw new JobsNotImplementedError({
|
|
93
93
|
feature: `introspection for the "${driver.name}" jobs driver`,
|
|
94
|
-
fix:
|
|
94
|
+
fix: 'call setJobDriver(createPgDriver()) at boot — only the pg driver implements introspect — then: x jobs ls --json',
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
return driver.introspect;
|
package/src/outbox.ts
CHANGED
|
@@ -338,7 +338,7 @@ export function jobsFacade(): JobsFacade {
|
|
|
338
338
|
throw new DriverUnavailableError({
|
|
339
339
|
driver: 'none',
|
|
340
340
|
cause: 'no queue driver is installed in this process',
|
|
341
|
-
fix: 'call setJobDriver(createMemoryDriver()) before enqueuing
|
|
341
|
+
fix: 'call setJobDriver(createMemoryDriver()) before enqueuing, or setJobDriver(createPgDriver()) for a real queue',
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
return installed;
|