From 0a34e74cba2d5af350a5fec91810a005ec5db056 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 26 Oct 2023 15:00:47 +0100 Subject: [PATCH] fix: set queue visibility --- stacks/billing-stack.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stacks/billing-stack.js b/stacks/billing-stack.js index 2776e35e..79a0b138 100644 --- a/stacks/billing-stack.js +++ b/stacks/billing-stack.js @@ -1,10 +1,10 @@ import { use, Cron, Queue, Function, Config } from '@serverless-stack/resources' import { StartingPosition } from 'aws-cdk-lib/aws-lambda' +import { Duration } from 'aws-cdk-lib' import { UcanInvocationStack } from './ucan-invocation-stack.js' import { BillingDbStack } from './billing-db-stack.js' import { UploadDbStack } from './upload-db-stack.js' import { setupSentry, getKinesisEventSourceConfig } from './config.js' -import { Duration } from 'aws-cdk-lib' /** @param {import('@serverless-stack/resources').StackContext} props */ export function BillingStack ({ stack, app }) { @@ -42,7 +42,8 @@ export function BillingStack ({ stack, app }) { consumer: { function: spaceBillingQueueHandler, cdk: { eventSource: { batchSize: 1 } } - } + }, + cdk: { queue: { visibilityTimeout: Duration.minutes(15) } } }) // Lambda that does a billing run for a given customer @@ -67,7 +68,8 @@ export function BillingStack ({ stack, app }) { consumer: { function: customerBillingQueueHandler, cdk: { eventSource: { batchSize: 1 } } - } + }, + cdk: { queue: { visibilityTimeout: Duration.minutes(15) } } }) // Lambda that queues account DIDs to be billed