@punks/backend-entity-manager 0.0.284 → 0.0.286
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 +19 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/extensions/jobs/services/jobs-service/service.d.ts +2 -2
- package/dist/esm/index.js +19 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/extensions/jobs/services/jobs-service/service.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -33979,10 +33979,11 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
|
|
|
33979
33979
|
instanceId,
|
|
33980
33980
|
payload,
|
|
33981
33981
|
});
|
|
33982
|
-
await this.instances.updateInstance(instanceId, {
|
|
33982
|
+
const instance = await this.instances.updateInstance(instanceId, {
|
|
33983
33983
|
status: exports.JobStatus.Ready,
|
|
33984
33984
|
});
|
|
33985
33985
|
this.logger.info(`JOB DISPATCH -> dispatching completed job ${job.uid} -> ${instanceId}`);
|
|
33986
|
+
return instance;
|
|
33986
33987
|
}
|
|
33987
33988
|
catch (e) {
|
|
33988
33989
|
await this.instances.updateInstance(instanceId, {
|
|
@@ -40017,7 +40018,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40017
40018
|
const jobDefName = jobDefinitionName(input.jobUid);
|
|
40018
40019
|
const jobDefinition = await this.getLatestJobDefinition(jobDefName);
|
|
40019
40020
|
const jobName = jobInstanceName(input.jobUid, input.instanceId);
|
|
40020
|
-
|
|
40021
|
+
const submitJobRequest = {
|
|
40021
40022
|
jobQueue: queue.jobQueueArn,
|
|
40022
40023
|
jobDefinition: jobDefinition.jobDefinitionArn,
|
|
40023
40024
|
jobName,
|
|
@@ -40025,8 +40026,14 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40025
40026
|
command: input.overrides?.command ??
|
|
40026
40027
|
jobDefinition.containerProperties.command,
|
|
40027
40028
|
},
|
|
40028
|
-
}
|
|
40029
|
-
this.logger.info(`AWS JOB -> job
|
|
40029
|
+
};
|
|
40030
|
+
this.logger.info(`AWS JOB -> submitting job ${jobName} ${queue.jobQueueArn}`, {
|
|
40031
|
+
request: submitJobRequest,
|
|
40032
|
+
});
|
|
40033
|
+
const result = await this.client().send(new clientBatch.SubmitJobCommand(submitJobRequest));
|
|
40034
|
+
this.logger.info(`AWS JOB -> job submitted ${jobName} ${queue.jobQueueArn}`, {
|
|
40035
|
+
result,
|
|
40036
|
+
});
|
|
40030
40037
|
}
|
|
40031
40038
|
async ensureJobDefinition(definition) {
|
|
40032
40039
|
const jobName = jobDefinitionName(definition.jobUid);
|
|
@@ -40069,6 +40076,10 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40069
40076
|
}
|
|
40070
40077
|
async getLatestJobDefinition(jobName) {
|
|
40071
40078
|
const jobs = await this.getActiveJobDefinitions(jobName);
|
|
40079
|
+
this.logger.debug(`AWS JOB -> latest job definition`, {
|
|
40080
|
+
jobName,
|
|
40081
|
+
jobs,
|
|
40082
|
+
});
|
|
40072
40083
|
return lodash.exports.orderBy(jobs, (x) => x.revision, "desc")[0];
|
|
40073
40084
|
}
|
|
40074
40085
|
async getActiveJobDefinitions(jobName) {
|
|
@@ -40079,11 +40090,15 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
|
|
|
40079
40090
|
return result.jobDefinitions ?? [];
|
|
40080
40091
|
}
|
|
40081
40092
|
async ensureQueue(queueName) {
|
|
40093
|
+
this.logger.debug(`AWS JOB -> ensuring queue ${queueName}`);
|
|
40082
40094
|
const queue = await this.getQueue(queueName);
|
|
40083
40095
|
if (queue) {
|
|
40096
|
+
this.logger.debug(`AWS JOB -> queue exists ${queueName}`);
|
|
40084
40097
|
return queue;
|
|
40085
40098
|
}
|
|
40099
|
+
this.logger.debug(`AWS JOB -> creating queue ${queueName}`);
|
|
40086
40100
|
await this.createQueue(queueName);
|
|
40101
|
+
this.logger.debug(`AWS JOB -> queue created ${queueName}`);
|
|
40087
40102
|
const currentQueue = await this.getQueue(queueName);
|
|
40088
40103
|
if (!currentQueue) {
|
|
40089
40104
|
throw new Error(`Queue not created -> ${queueName}`);
|