fix: replace webhook endpoint with a bullmq job
This commit is contained in:
@ -15,6 +15,7 @@ import {
|
||||
CreateLabelInput,
|
||||
} from '../generated/graphql'
|
||||
import { BulkActionData, BULK_ACTION_JOB_NAME } from '../jobs/bulk_action'
|
||||
import { CallWebhookJobData, CALL_WEBHOOK_JOB_NAME } from '../jobs/call_webhook'
|
||||
import { THUMBNAIL_JOB } from '../jobs/find_thumbnail'
|
||||
import { queueRSSRefreshFeedJob } from '../jobs/rss/refreshAllFeeds'
|
||||
import { TriggerRuleJobData, TRIGGER_RULE_JOB_NAME } from '../jobs/trigger_rule'
|
||||
@ -670,6 +671,20 @@ export const enqueueTriggerRuleJob = async (data: TriggerRuleJobData) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const enqueueWebhookJob = async (data: CallWebhookJobData) => {
|
||||
const queue = await getBackendQueue()
|
||||
if (!queue) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return queue.add(CALL_WEBHOOK_JOB_NAME, data, {
|
||||
priority: 1,
|
||||
attempts: 1,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
})
|
||||
}
|
||||
|
||||
export const bulkEnqueueUpdateLabels = async (data: UpdateLabelsData[]) => {
|
||||
const queue = await getBackendQueue()
|
||||
if (!queue) {
|
||||
|
||||
Reference in New Issue
Block a user