Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"sqlite3"
],
"overrides": {
"axios": "1.7.9",
"axios": "1.10.0",
"body-parser": "2.0.2",
"braces": "3.0.3",
"cross-spawn": "7.0.6",
Expand All @@ -76,10 +76,14 @@
"nth-check": "2.1.1",
"path-to-regexp": "0.1.12",
"prismjs": "1.29.0",
"rollup": "4.45.0",
"semver": "7.7.1",
"set-value": "4.1.0",
"tar-fs": "3.1.0",
"unset-value": "2.0.1",
"webpack-dev-middleware": "7.4.2"
"webpack-dev-middleware": "7.4.2",
"ws": "8.18.3",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
}
},
"engines": {
Expand Down
5 changes: 2 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"openai": "^4.96.0",
"papaparse": "^5.4.1",
"pdf-parse": "^1.1.1",
"pdfjs-dist": "^3.7.107",
"pdfjs-dist": "^5.3.93",
"pg": "^8.11.2",
"playwright": "^1.35.0",
"puppeteer": "^20.7.1",
Expand All @@ -148,13 +148,12 @@
"@swc/core": "^1.3.99",
"@types/crypto-js": "^4.1.1",
"@types/gulp": "4.0.9",
"@types/lodash": "^4.14.202",
"@types/lodash": "^4.17.20",
"@types/node-fetch": "2.6.2",
"@types/object-hash": "^3.0.2",
"@types/papaparse": "^5.3.15",
"@types/pg": "^8.10.2",
"@types/ws": "^8.5.3",
"babel-register": "^6.26.0",
"gulp": "^4.0.2",
"rimraf": "^5.0.5",
"tsc-watch": "^6.0.4",
Expand Down
7 changes: 4 additions & 3 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.699.0",
"@bull-board/api": "^6.11.0",
"@bull-board/express": "^6.11.0",
"@google-cloud/logging-winston": "^6.0.0",
"@keyv/redis": "^4.2.0",
"@oclif/core": "4.0.7",
Expand All @@ -79,15 +81,14 @@
"@opentelemetry/sdk-trace-base": "1.27.0",
"@opentelemetry/semantic-conventions": "1.27.0",
"@types/bcryptjs": "^2.4.6",
"@types/lodash": "^4.14.202",
"@types/lodash": "^4.17.20",
"@types/passport": "^1.0.16",
"@types/passport-jwt": "^4.0.1",
"@types/passport-local": "^1.0.38",
"@types/uuid": "^9.0.7",
"async-mutex": "^0.4.0",
"axios": "1.7.9",
"bcryptjs": "^2.4.3",
"bull-board": "^2.1.3",
"bullmq": "5.45.2",
"cache-manager": "^6.3.2",
"connect-pg-simple": "^10.0.0",
Expand Down Expand Up @@ -169,7 +170,7 @@
"cypress": "^13.13.0",
"jest": "^29.7.0",
"nodemon": "^2.0.22",
"oclif": "^3",
"oclif": "^4.20.5",
"rimraf": "^5.0.5",
"run-script-os": "^1.1.6",
"shx": "^0.3.3",
Expand Down
6 changes: 5 additions & 1 deletion packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { Workspace } from './enterprise/database/entities/workspace.entity'
import { Organization } from './enterprise/database/entities/organization.entity'
import { GeneralRole, Role } from './enterprise/database/entities/role.entity'
import { migrateApiKeysFromJsonToDb } from './utils/apiKey'
import { ExpressAdapter } from '@bull-board/express'

declare global {
namespace Express {
Expand Down Expand Up @@ -128,13 +129,16 @@ export class App {
// Init Queues
if (process.env.MODE === MODE.QUEUE) {
this.queueManager = QueueManager.getInstance()
const serverAdapter = new ExpressAdapter()
serverAdapter.setBasePath('/admin/queues')
this.queueManager.setupAllQueues({
componentNodes: this.nodesPool.componentNodes,
telemetry: this.telemetry,
cachePool: this.cachePool,
appDataSource: this.AppDataSource,
abortControllerPool: this.abortControllerPool,
usageCacheManager: this.usageCacheManager
usageCacheManager: this.usageCacheManager,
serverAdapter
})
logger.info('✅ [Queue]: All queues setup successfully')

Expand Down
18 changes: 13 additions & 5 deletions packages/server/src/queue/QueueManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { CachePool } from '../CachePool'
import { DataSource } from 'typeorm'
import { AbortControllerPool } from '../AbortControllerPool'
import { QueueEventsProducer, RedisOptions } from 'bullmq'
import { createBullBoard } from 'bull-board'
import { BullMQAdapter } from 'bull-board/bullMQAdapter'
import { createBullBoard } from '@bull-board/api'
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter'
import { Express } from 'express'
import { UsageCacheManager } from '../UsageCacheManager'
import { ExpressAdapter } from '@bull-board/express'

const QUEUE_NAME = process.env.QUEUE_NAME || 'flowise-queue'

Expand Down Expand Up @@ -98,14 +99,16 @@ export class QueueManager {
cachePool,
appDataSource,
abortControllerPool,
usageCacheManager
usageCacheManager,
serverAdapter
}: {
componentNodes: IComponentNodes
telemetry: Telemetry
cachePool: CachePool
appDataSource: DataSource
abortControllerPool: AbortControllerPool
usageCacheManager: UsageCacheManager
serverAdapter?: ExpressAdapter
}) {
const predictionQueueName = `${QUEUE_NAME}-prediction`
const predictionQueue = new PredictionQueue(predictionQueueName, this.connection, {
Expand All @@ -131,7 +134,12 @@ export class QueueManager {
})
this.registerQueue('upsert', upsertionQueue)

const bullboard = createBullBoard([new BullMQAdapter(predictionQueue.getQueue()), new BullMQAdapter(upsertionQueue.getQueue())])
this.bullBoardRouter = bullboard.router
if (serverAdapter) {
createBullBoard({
queues: [new BullMQAdapter(predictionQueue.getQueue()), new BullMQAdapter(upsertionQueue.getQueue())],
serverAdapter: serverAdapter
})
this.bullBoardRouter = serverAdapter.getRouter()
}
}
}
Loading