@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
|
@@ -9,6 +9,6 @@ export declare class JobDispatchHandler implements ICommandHandler<JobDispatchCo
|
|
|
9
9
|
private readonly instances;
|
|
10
10
|
private readonly logger;
|
|
11
11
|
constructor(lock: OperationLockService, executor: JobProviderExecutor, instances: IJobInstancesRepository);
|
|
12
|
-
execute(command: JobDispatchCommand): Promise<
|
|
12
|
+
execute(command: JobDispatchCommand): Promise<import("../../abstractions").JobInstance | undefined>;
|
|
13
13
|
private dispatchJob;
|
|
14
14
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -33942,10 +33942,11 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
|
|
|
33942
33942
|
}
|
|
33943
33943
|
async execute(command) {
|
|
33944
33944
|
const { input: { job }, } = command;
|
|
33945
|
-
await this.lock.executeExclusive({
|
|
33945
|
+
const result = await this.lock.executeExclusive({
|
|
33946
33946
|
lockUid: `job-dispatch-${job.uid}`,
|
|
33947
33947
|
operation: async () => await this.dispatchJob(command),
|
|
33948
33948
|
});
|
|
33949
|
+
return result.result;
|
|
33949
33950
|
}
|
|
33950
33951
|
async dispatchJob(command) {
|
|
33951
33952
|
const { input: { job, schedule, runType, payload }, } = command;
|
|
@@ -33964,11 +33965,11 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
|
|
|
33964
33965
|
instanceId,
|
|
33965
33966
|
payload,
|
|
33966
33967
|
});
|
|
33967
|
-
|
|
33968
|
+
await this.instances.updateInstance(instanceId, {
|
|
33968
33969
|
status: JobStatus.Ready,
|
|
33969
33970
|
});
|
|
33970
33971
|
this.logger.info(`JOB DISPATCH -> dispatching completed job ${job.uid} -> ${instanceId}`);
|
|
33971
|
-
return
|
|
33972
|
+
return await this.instances.getById(instanceId);
|
|
33972
33973
|
}
|
|
33973
33974
|
catch (e) {
|
|
33974
33975
|
await this.instances.updateInstance(instanceId, {
|