Adding debug log for handling waiting list email and preventing other parallel methods from throwing
This commit is contained in:
parent
1abaa934b0
commit
99466bd1f4
1 changed files with 8 additions and 2 deletions
|
|
@ -56,8 +56,10 @@ export class WaitingListService {
|
|||
if (!this.isRelevantEmail(email)) return
|
||||
|
||||
await Promise.all([
|
||||
this.ntfyProvider.sendWaitListEmailReceivedNotification(email.subject),
|
||||
this.emailProvider.readEmails([email]),
|
||||
this.ntfyProvider
|
||||
.sendWaitListEmailReceivedNotification(email.subject)
|
||||
.catch(this.loggerService.error),
|
||||
this.emailProvider.readEmails([email]).catch(this.loggerService.error),
|
||||
this.handleWaitingListEmail(email),
|
||||
])
|
||||
}
|
||||
|
|
@ -65,6 +67,10 @@ export class WaitingListService {
|
|||
private async handleWaitingListEmail(email: Email) {
|
||||
const { date, startTime } = this.getWaitingListDetails(email)
|
||||
const dateRangeStart = dayjs(`${date} ${startTime}`, 'YYYY-MM-DD HH:mm')
|
||||
this.loggerService.debug('Handling waiting list email', {
|
||||
date,
|
||||
startTime,
|
||||
})
|
||||
if (!dateRangeStart.isValid()) {
|
||||
this.loggerService.error('Invalid date parsed from email', {
|
||||
date,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue