fix: send discord notifications only from the staging server
This commit is contained in:
parent
81dd4fb8fe
commit
aa4f024dea
|
@ -32,9 +32,12 @@ import { UnbodyHelpers } from './unbody.helpers'
|
|||
const isBuildTime = process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD
|
||||
const isVercel = process.env.VERCEL === '1'
|
||||
|
||||
const websiteUrl = getWebsiteUrl()
|
||||
const discordWebhookURL = process.env.DISCORD_LOGS_WEBHOOK_URL || ''
|
||||
const sendDiscordNotifications =
|
||||
process.env.NODE_ENV === 'production' && !!discordWebhookURL
|
||||
process.env.NODE_ENV === 'production' &&
|
||||
!!discordWebhookURL &&
|
||||
websiteUrl.includes('dev-') // temporary solution to avoid sending duplicate notification messages
|
||||
|
||||
const discordWebhook = new WebhookClient({
|
||||
url: discordWebhookURL,
|
||||
|
|
Loading…
Reference in New Issue