1
- import { Consumer } from "sqs-consumer" ;
2
- import { PrismaClientOrTransaction , prisma } from "~/db.server" ;
3
- import { logger , trace } from "../logger.server" ;
4
1
import { Message , SQSClient } from "@aws-sdk/client-sqs" ;
5
- import { authenticateApiKey } from "../apiAuth.server" ;
6
2
import { SendEventBodySchema } from "@trigger.dev/core" ;
3
+ import { Consumer } from "sqs-consumer" ;
7
4
import { z } from "zod" ;
8
5
import { fromZodError } from "zod-validation-error" ;
9
- import { IngestSendEvent } from "./ingestSendEvent .server" ;
6
+ import { PrismaClientOrTransaction , prisma } from "~/db .server" ;
10
7
import { env } from "~/env.server" ;
11
- import { singleton } from "~/utils/singleton" ;
8
+ import { authenticateApiKey } from "../apiAuth.server" ;
9
+ import { logger , trace } from "../logger.server" ;
10
+ import { IngestSendEvent } from "./ingestSendEvent.server" ;
12
11
13
12
type SqsEventConsumerOptions = {
14
13
queueUrl : string ;
@@ -17,6 +16,7 @@ type SqsEventConsumerOptions = {
17
16
region : string ;
18
17
accessKeyId : string ;
19
18
secretAccessKey : string ;
19
+ pollingWaitTimeMs : number ;
20
20
} ;
21
21
22
22
const messageSchema = SendEventBodySchema . extend ( {
@@ -137,6 +137,7 @@ export function getSharedSqsEventConsumer() {
137
137
const consumer = new SqsEventConsumer ( undefined , {
138
138
queueUrl : env . AWS_SQS_QUEUE_URL ,
139
139
batchSize : env . AWS_SQS_BATCH_SIZE ,
140
+ pollingWaitTimeMs : env . AWS_SQS_WAIT_TIME_MS ,
140
141
region : env . AWS_SQS_REGION ,
141
142
accessKeyId : env . AWS_SQS_ACCESS_KEY_ID ,
142
143
secretAccessKey : env . AWS_SQS_SECRET_ACCESS_KEY ,
0 commit comments