@punks/backend-entity-manager 0.0.289 → 0.0.291
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/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/extensions/jobs/commands/job-dispatch/handler.d.ts +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/extensions/jobs/commands/job-dispatch/handler.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -33957,10 +33957,11 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
|
|
|
33957
33957
|
}
|
|
33958
33958
|
async execute(command) {
|
|
33959
33959
|
const { input: { job }, } = command;
|
|
33960
|
-
await this.lock.executeExclusive({
|
|
33960
|
+
const result = await this.lock.executeExclusive({
|
|
33961
33961
|
lockUid: `job-dispatch-${job.uid}`,
|
|
33962
33962
|
operation: async () => await this.dispatchJob(command),
|
|
33963
33963
|
});
|
|
33964
|
+
return result.result;
|
|
33964
33965
|
}
|
|
33965
33966
|
async dispatchJob(command) {
|
|
33966
33967
|
const { input: { job, schedule, runType, payload }, } = command;
|
|
@@ -33979,11 +33980,11 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
|
|
|
33979
33980
|
instanceId,
|
|
33980
33981
|
payload,
|
|
33981
33982
|
});
|
|
33982
|
-
|
|
33983
|
+
await this.instances.updateInstance(instanceId, {
|
|
33983
33984
|
status: exports.JobStatus.Ready,
|
|
33984
33985
|
});
|
|
33985
33986
|
this.logger.info(`JOB DISPATCH -> dispatching completed job ${job.uid} -> ${instanceId}`);
|
|
33986
|
-
return
|
|
33987
|
+
return await this.instances.getById(instanceId);
|
|
33987
33988
|
}
|
|
33988
33989
|
catch (e) {
|
|
33989
33990
|
await this.instances.updateInstance(instanceId, {
|