@halcyon-agile/adonis-bull
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -7,2 +7,4 @@ "use strict"; | ||
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter'); | ||
const { ExpressAdapter } = require('@bull-board/express'); | ||
const express = require('express'); | ||
class BullManager { | ||
@@ -73,8 +75,15 @@ constructor(container, Logger, config, jobs) { | ||
ui(port = 9999) { | ||
const board = createBullBoard(Object.keys(this.queues).map((key) => new BullMQAdapter(this.getByKey(key).bull))); | ||
const server = board.router.listen(port, () => { | ||
const app = express(); | ||
const serverAdapter = new ExpressAdapter(); | ||
serverAdapter.setBasePath('/'); | ||
createBullBoard({ | ||
queues: Object.keys(this.queues).map((key) => new BullMQAdapter(this.getByKey(key).bull)), | ||
serverAdapter: serverAdapter, | ||
}); | ||
app.use('/', serverAdapter.getRouter()); | ||
app.listen(port, () => { | ||
this.Logger.info(`bull board on http://localhost:${port}`); | ||
}); | ||
const shutdown = async () => { | ||
await server.close(() => { | ||
await app.close(() => { | ||
this.Logger.info('Stopping bull board server'); | ||
@@ -81,0 +90,0 @@ }); |
{ | ||
"name": "@halcyon-agile/adonis-bull", | ||
"description": "The easiest way to start using an asynchronous job queue with AdonisJS. Supports version 5 and 4.x", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"main": "build/providers/BullProvider.js", | ||
@@ -6,0 +6,0 @@ "types": "build/adonis-typings/index.d.ts", |
41538
608