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
|
if (!this.isRelevantEmail(email)) return
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.ntfyProvider.sendWaitListEmailReceivedNotification(email.subject),
|
this.ntfyProvider
|
||||||
this.emailProvider.readEmails([email]),
|
.sendWaitListEmailReceivedNotification(email.subject)
|
||||||
|
.catch(this.loggerService.error),
|
||||||
|
this.emailProvider.readEmails([email]).catch(this.loggerService.error),
|
||||||
this.handleWaitingListEmail(email),
|
this.handleWaitingListEmail(email),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
@ -65,6 +67,10 @@ export class WaitingListService {
|
||||||
private async handleWaitingListEmail(email: Email) {
|
private async handleWaitingListEmail(email: Email) {
|
||||||
const { date, startTime } = this.getWaitingListDetails(email)
|
const { date, startTime } = this.getWaitingListDetails(email)
|
||||||
const dateRangeStart = dayjs(`${date} ${startTime}`, 'YYYY-MM-DD HH:mm')
|
const dateRangeStart = dayjs(`${date} ${startTime}`, 'YYYY-MM-DD HH:mm')
|
||||||
|
this.loggerService.debug('Handling waiting list email', {
|
||||||
|
date,
|
||||||
|
startTime,
|
||||||
|
})
|
||||||
if (!dateRangeStart.isValid()) {
|
if (!dateRangeStart.isValid()) {
|
||||||
this.loggerService.error('Invalid date parsed from email', {
|
this.loggerService.error('Invalid date parsed from email', {
|
||||||
date,
|
date,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue