@punks/backend-entity-manager 0.0.311 → 0.0.313

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 CHANGED
@@ -33878,6 +33878,7 @@ exports.JobsService = class JobsService {
33878
33878
  schedule,
33879
33879
  runType: exports.JobRunType.OnDemand,
33880
33880
  payload: input.payload,
33881
+ commandPlaceholders: input.commandPlaceholders,
33881
33882
  }));
33882
33883
  };
33883
33884
  this.updateJob = async (input) => {
@@ -33978,7 +33979,7 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33978
33979
  return result.result;
33979
33980
  }
33980
33981
  async dispatchJob(command) {
33981
- const { input: { job, schedule, runType, payload }, } = command;
33982
+ const { input: { job, schedule, runType, payload, commandPlaceholders }, } = command;
33982
33983
  const instanceId = backendCore.newUuid();
33983
33984
  try {
33984
33985
  this.logger.info(`JOB DISPATCH -> dispatching started job ${job.uid} -> ${instanceId}`);
@@ -33993,6 +33994,7 @@ let JobDispatchHandler = JobDispatchHandler_1 = class JobDispatchHandler {
33993
33994
  schedule,
33994
33995
  instanceId,
33995
33996
  payload,
33997
+ commandPlaceholders,
33996
33998
  });
33997
33999
  await this.instances.updateInstance(instanceId, {
33998
34000
  status: exports.JobStatus.Ready,
@@ -40049,7 +40051,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
40049
40051
  return result.jobSummaryList?.[0];
40050
40052
  }
40051
40053
  async submitJob(input) {
40052
- this.logger.info(`AWS JOB -> submitting job`, {
40054
+ this.logger.info(`AWS JOB -> submitting job triggered`, {
40053
40055
  input,
40054
40056
  });
40055
40057
  const queue = await this.ensureQueue(this.awsSettings.defaultQueueName);
@@ -40069,7 +40071,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
40069
40071
  }
40070
40072
  : {}),
40071
40073
  };
40072
- this.logger.info(`AWS JOB -> submitting job ${jobName} ${queue.jobQueueArn}`, {
40074
+ this.logger.info(`AWS JOB -> invoking job ${jobName} ${queue.jobQueueArn}`, {
40073
40075
  request: submitJobRequest,
40074
40076
  });
40075
40077
  const result = await this.client().send(new clientBatch.SubmitJobCommand(submitJobRequest));
@@ -40157,7 +40159,7 @@ let AwsBatchService = AwsBatchService_1 = class AwsBatchService {
40157
40159
  async ensureJobLogDriver(jobName, definition) {
40158
40160
  const logGroup = definition.infrastructureParams.logGroupName
40159
40161
  ? {
40160
- name: `/aws/batch/job-${definition.infrastructureParams.logGroupName}`,
40162
+ name: `/aws/batch/${awsBatchSettings.value.batchResourcesPrefix}-job-${definition.infrastructureParams.logGroupName}`,
40161
40163
  }
40162
40164
  : undefined;
40163
40165
  if (!logGroup) {
@@ -40254,12 +40256,13 @@ let AwsJobsProvider = class AwsJobsProvider {
40254
40256
  }
40255
40257
  async dispatch(input) {
40256
40258
  const { definition, schedule, instanceId, payload, commandPlaceholders } = input;
40257
- const awsInvocationParams = schedule?.invocationOverrides;
40259
+ const awsInvocationParams = schedule?.invocationOverrides ??
40260
+ definition.invocationParams;
40258
40261
  await this.awsBatchService.submitJob({
40259
40262
  instanceId,
40260
40263
  jobUid: definition.uid,
40261
40264
  overrides: {
40262
- command: awsInvocationParams?.startCommand?.map((x) => replacePlaceholders(replacePayload(x, payload), commandPlaceholders)),
40265
+ command: awsInvocationParams.startCommand?.map((x) => replacePlaceholders(replacePayload(x, payload), commandPlaceholders)),
40263
40266
  },
40264
40267
  });
40265
40268
  }