Skip to content

Commit 08e3065

Browse files
committed
Logging and function name change
1 parent 719b1b2 commit 08e3065

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

packages/postDatedLambda/src/businessLogic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function processMessage(
6666
// NOTE: It is technically possible for the array to be empty if no existing records are found
6767
// This SHOULD never happen in practice, but catch it anyway
6868
if (message.existingRecords.length === 0) {
69-
logger.error("No existing records found for post-dated prescription, cannot process", {
69+
logger.error("No existing records found for post-dated prescription, cannot process. Ignoring this message", {
7070
badMessage: message
7171
})
7272

packages/postDatedLambda/src/databaseClient.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,5 @@ export async function enrichMessagesWithExistingRecords(
199199
existingRecords: recordsMap.get(message.prescriptionData.PrescriptionID) ?? []
200200
}))
201201

202-
for (const msg of enrichedMessages) {
203-
logger.info("Prescription and most recent existing record", {
204-
prescriptionID: msg.prescriptionData.PrescriptionID,
205-
existingRecordCount: msg.existingRecords.length
206-
})
207-
}
208-
209202
return enrichedMessages
210203
}

packages/postDatedLambda/src/sqs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export async function receivePostDatedSQSMessages(logger: Logger): Promise<Array
238238
/**
239239
* Forward matured post-dated messages to the Notify queue using the same payload as the update lambda.
240240
*/
241-
export async function sendSQSMessagesToNotificationQueue(
241+
export async function forwardSQSMessagesToNotificationQueue(
242242
logger: Logger,
243243
messages: Array<PostDatedSQSMessage>
244244
): Promise<Array<string>> {
@@ -383,7 +383,7 @@ export async function handleProcessedMessages(
383383
const {maturedPrescriptionUpdates, immaturePrescriptionUpdates, ignoredPrescriptionUpdates} = result
384384

385385
// Move matured messages to the notification queue and remove them from the post-dated queue
386-
await sendSQSMessagesToNotificationQueue(logger, maturedPrescriptionUpdates)
386+
await forwardSQSMessagesToNotificationQueue(logger, maturedPrescriptionUpdates)
387387
await removeSQSMessages(logger, maturedPrescriptionUpdates)
388388

389389
// Return failed messages to the queue

0 commit comments

Comments
 (0)