mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
log unknown channel
This commit is contained in:
parent
a9dd2d0d4c
commit
7b2e336eca
1 changed files with 5 additions and 5 deletions
|
|
@ -595,8 +595,8 @@ const sendEmail = async (user: User, digest: Digest) => {
|
|||
|
||||
const sendNotifications = async (
|
||||
user: User,
|
||||
channels: Channel[],
|
||||
digest: Digest
|
||||
digest: Digest,
|
||||
channels: Channel[] = ['push'] // default to push notification
|
||||
) => {
|
||||
const deduplicateChannels = [...new Set(channels)]
|
||||
|
||||
|
|
@ -608,6 +608,8 @@ const sendNotifications = async (
|
|||
case 'email':
|
||||
return sendEmail(user, digest)
|
||||
default:
|
||||
logger.error('Unknown channel', { channel })
|
||||
return
|
||||
}
|
||||
})
|
||||
)
|
||||
|
|
@ -721,10 +723,8 @@ export const createDigest = async (jobData: CreateDigestData) => {
|
|||
jobState: TaskState.Failed,
|
||||
})
|
||||
} finally {
|
||||
// default to push notification
|
||||
const channels = config?.channels ?? ['push']
|
||||
// send notification
|
||||
await sendNotifications(user, channels, digest)
|
||||
await sendNotifications(user, digest, config?.channels)
|
||||
|
||||
console.timeEnd('createDigestJob')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue