mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
@@ -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",
|
||||
@@ -79,7 +81,7 @@
|
||||
"@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",
|
||||
@@ -87,7 +89,6 @@
|
||||
"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",
|
||||
@@ -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",
|
||||
|
||||
@@ -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 {
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -98,7 +99,8 @@ export class QueueManager {
|
||||
cachePool,
|
||||
appDataSource,
|
||||
abortControllerPool,
|
||||
usageCacheManager
|
||||
usageCacheManager,
|
||||
serverAdapter
|
||||
}: {
|
||||
componentNodes: IComponentNodes
|
||||
telemetry: Telemetry
|
||||
@@ -106,6 +108,7 @@ export class QueueManager {
|
||||
appDataSource: DataSource
|
||||
abortControllerPool: AbortControllerPool
|
||||
usageCacheManager: UsageCacheManager
|
||||
serverAdapter?: ExpressAdapter
|
||||
}) {
|
||||
const predictionQueueName = `${QUEUE_NAME}-prediction`
|
||||
const predictionQueue = new PredictionQueue(predictionQueueName, this.connection, {
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user