Skip to content

Commit

Permalink
Merge pull request activepieces#5358 from activepieces/fix/app-event
Browse files Browse the repository at this point in the history
fix: app event routing
  • Loading branch information
abuaboud authored Aug 14, 2024
2 parents 024b28f + 3ee3c07 commit a4eafe8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { FastifyRequest } from 'fastify'
import { StatusCodes } from 'http-status-codes'
import { DEFAULT_PRIORITY } from '../workers/queue/queue-manager'
import { appEventRoutingService } from './app-event-routing.service'
import { flowQueue } from '../workers/queue'

const appWebhooks: Record<string, Piece> = {
slack,
Expand Down Expand Up @@ -97,7 +98,7 @@ export const appEventRoutingController: FastifyPluginAsyncTypebox = async (
})
const eventsQueue = listeners.map(async (listener) => {
const requestId = apId()
return {
return flowQueue.add({
id: requestId,
type: JobType.WEBHOOK,
data: {
Expand All @@ -110,7 +111,7 @@ export const appEventRoutingController: FastifyPluginAsyncTypebox = async (
simulate: false,
},
priority: DEFAULT_PRIORITY,
}
})
})
rejectedPromiseHandler(Promise.all(eventsQueue))
return requestReply.status(StatusCodes.OK).send({})
Expand Down

0 comments on commit a4eafe8

Please sign in to comment.