@adminforth/background-jobs 1.8.0 → 1.8.1
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/index.js +3 -3
- package/index.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -373,13 +373,13 @@ export default class BackgroundJobsPlugin extends AdminForthPlugin {
|
|
|
373
373
|
return JSON.parse(state);
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
updateJobFieldsAtomically(jobId, updateFunction) {
|
|
377
377
|
return __awaiter(this, void 0, void 0, function* () {
|
|
378
378
|
if (!jobId) {
|
|
379
|
-
throw new Error('
|
|
379
|
+
throw new Error('updateJobFieldsAtomically: jobId is required');
|
|
380
380
|
}
|
|
381
381
|
if (typeof updateFunction !== 'function') {
|
|
382
|
-
throw new Error('
|
|
382
|
+
throw new Error('updateJobFieldsAtomically: updateFunction must be a function');
|
|
383
383
|
}
|
|
384
384
|
// Ensure updates are atomic per jobId.
|
|
385
385
|
// Different jobs are not blocked by each other.
|
package/index.ts
CHANGED
|
@@ -404,12 +404,12 @@ export default class BackgroundJobsPlugin extends AdminForthPlugin {
|
|
|
404
404
|
return JSON.parse(state);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
public async
|
|
407
|
+
public async updateJobFieldsAtomically(jobId: string, updateFunction: () => Promise<void>) {
|
|
408
408
|
if (!jobId) {
|
|
409
|
-
throw new Error('
|
|
409
|
+
throw new Error('updateJobFieldsAtomically: jobId is required');
|
|
410
410
|
}
|
|
411
411
|
if (typeof updateFunction !== 'function') {
|
|
412
|
-
throw new Error('
|
|
412
|
+
throw new Error('updateJobFieldsAtomically: updateFunction must be a function');
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
// Ensure updates are atomic per jobId.
|