Skip to content

Commit

Permalink
Track app and log message
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry committed Nov 3, 2023
1 parent 603623f commit 639e057
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/enhanced/enhancedApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ async function app(): Promise<void> {
}
}

app();
AWSXRay.captureAsyncFunc('send', (subsegment) => {
app();
subsegment?.close();
});

process.on('SIGTERM', async () => {
await cleanupJob();
Expand Down
2 changes: 2 additions & 0 deletions src/enhanced/utils/queue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export async function listenToJobQueue(): Promise<JobsQueuePayload> {

const message = res.Messages[0];

console.log('[listenToJobQueue]: Message found', message);

// Before we delete the message from the queue, we want to protect the task.
// This is because if protect the task after we delete, we could end up with a condition
// where the task is unprotected, and it deletes a message. This means that if we happen
Expand Down

0 comments on commit 639e057

Please sign in to comment.