Merge pull request #4304 from omnivore-app/fix/newsletter
add debugging logs for inbound-email-handler and keep email job data once completed or failed
This commit is contained in:
@ -55,7 +55,10 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
||||
console.log('no data or name for ', part)
|
||||
}
|
||||
}
|
||||
console.log('parsed', parsed)
|
||||
|
||||
const headers = parseHeaders(parsed.headers)
|
||||
console.log('headers', headers)
|
||||
|
||||
// original sender email address
|
||||
const from = parsed['from']
|
||||
@ -89,7 +92,7 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
||||
// check if it is a subscription or google confirmation email
|
||||
const isGoogleConfirmation = isGoogleConfirmationEmail(from, subject)
|
||||
if (isGoogleConfirmation || isSubscriptionConfirmationEmail(subject)) {
|
||||
console.debug('handleConfirmation', from, subject)
|
||||
console.log('handleConfirmation', from, subject)
|
||||
// we need to parse the confirmation code from the email
|
||||
if (isGoogleConfirmation) {
|
||||
await handleGoogleConfirmationEmail(
|
||||
@ -114,7 +117,7 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
||||
return res.send('ok')
|
||||
}
|
||||
if (attachments.length > 0) {
|
||||
console.debug('handle attachments', from, to, subject)
|
||||
console.log('handle attachments', from, to, subject)
|
||||
// save the attachments as articles
|
||||
await handleAttachments(
|
||||
redisDataSource,
|
||||
|
||||
@ -49,8 +49,6 @@ const getPriority = (jobType: EmailJobType): number => {
|
||||
|
||||
const getOpts = (jobType: EmailJobType): BulkJobOptions => {
|
||||
return {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
attempts: 3,
|
||||
priority: getPriority(jobType),
|
||||
backoff: {
|
||||
|
||||
Reference in New Issue
Block a user