diff --git a/consumer-server/src/components.ts b/consumer-server/src/components.ts index 22b2994a..9867ef9e 100644 --- a/consumer-server/src/components.ts +++ b/consumer-server/src/components.ts @@ -30,8 +30,8 @@ export async function initComponents(): Promise { const sqsQueue = await config.getString('TASK_QUEUE') const taskQueue = sqsQueue ? - createSqsAdapter({ logs, metrics }, { queueUrl: sqsQueue, queueRegion: AWS_REGION }) : - createMemoryQueueAdapter({ logs, metrics }, { queueName: "ConversionTaskQueue" }) + createSqsAdapter({ logs, metrics }, { queueUrl: sqsQueue, queueRegion: AWS_REGION }) : + createMemoryQueueAdapter({ logs, metrics }, { queueName: "ConversionTaskQueue" }) const s3Bucket = await config.getString('CDN_BUCKET') const cdnS3 = s3Bucket ? new AWS.S3({}) : new MockAws.S3({}) diff --git a/consumer-server/src/controllers/handlers/queue-conversion-handle.ts b/consumer-server/src/controllers/handlers/queue-conversion-handle.ts index 5a57966d..69a4064f 100644 --- a/consumer-server/src/controllers/handlers/queue-conversion-handle.ts +++ b/consumer-server/src/controllers/handlers/queue-conversion-handle.ts @@ -16,7 +16,7 @@ export async function queueTaskHandler(context: HandlerContextWithPath<"metrics" if (!DeploymentToSqs.validate(body)) return { status: 403, body: { errors: DeploymentToSqs.validate.errors } } - const message = await taskQueue.publish(body as DeploymentToSqs & { lodBucketDirectory: string | undefined; }) + const message = await taskQueue.publish(body as DeploymentToSqs & { lods: string[] | undefined; }) return { status: 201, diff --git a/consumer-server/src/logic/conversion-task.ts b/consumer-server/src/logic/conversion-task.ts index 06d57ddf..4e42dab2 100644 --- a/consumer-server/src/logic/conversion-task.ts +++ b/consumer-server/src/logic/conversion-task.ts @@ -73,7 +73,7 @@ function getAbVersionEnvName(buildTarget: string) } } -export async function executeLODConversion(components: Pick, entityId: string, lodBucketDirectory: string) { +export async function executeLODConversion(components: Pick, entityId: string, lods: string[]) { const $LOD_BUCKET = await components.config.getString('LOD_BUCKET') if (!$LOD_BUCKET) { throw new Error('LOD_BUCKET is not defined') @@ -92,7 +92,7 @@ export async function executeLODConversion(components: Pick { try { components.metrics.increment('ab_converter_running_conversion') - if (job.lodBucketDirectory) { - await executeLODConversion(components, job.entity.entityId, job.lodBucketDirectory) + if (job.lods) { + await executeLODConversion(components, job.entity.entityId, job.lods) } else { await executeConversion(components, job.entity.entityId, job.contentServerUrls![0], job.force) } diff --git a/consumer-server/src/types.ts b/consumer-server/src/types.ts index 06bc0525..517728ba 100644 --- a/consumer-server/src/types.ts +++ b/consumer-server/src/types.ts @@ -22,7 +22,7 @@ export type BaseComponents = { logs: ILoggerComponent server: IHttpServerComponent fetch: IFetchComponent - taskQueue: ITaskQueue + taskQueue: ITaskQueue metrics: IMetricsComponent cdnS3: S3 runner: IRunnerComponent