Skip to content

Commit

Permalink
feat(web): add new indices to request and improve queue retries
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrnt committed Jun 20, 2024
1 parent fe05b9e commit c42a6fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/web/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,6 @@ model ApiRequest {
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
@@index([projectId])
@@index([createdAt])
@@index([type])
}
14 changes: 14 additions & 0 deletions apps/web/src/server/queue/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,25 @@ export const getQueueingRedisConnection = () =>

export const eventQueue = new Queue<EventJobPayload>(QUEUE_NAMES.events, {
connection: getQueueingRedisConnection(),
defaultJobOptions: {
attempts: 3,
backoff: {
type: "exponential",
delay: 1000,
},
},
});

export const afterDataRequestQueue = new Queue<AfterRequestJobPayload>(
QUEUE_NAMES.afterDataRequestQueue,
{
connection: getQueueingRedisConnection(),
defaultJobOptions: {
attempts: 3,
backoff: {
type: "exponential",
delay: 1000,
},
},
}
);

0 comments on commit c42a6fe

Please sign in to comment.