Skip to content

Commit

Permalink
fix: bullboard ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Feb 28, 2024
1 parent c1e8bf9 commit c0502f2
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cfg/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
}
},
"queueCleanup": {
"ttlAfterFinished": 10000,
"cleanInterval": 10000
"ttlAfterFinished": 86400000,
"cleanInterval": 86400000
}
}
170 changes: 170 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"c8": "^9.1.0",
"copyfiles": "^2.4.1",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"esbuild": "^0.20.1",
Expand All @@ -75,10 +76,11 @@
"mochadebug": "cross-env NODE_ENV=test mocha --inspect-brk --full-trace --exit --trace-warnings --exit",
"lcov-report": "c8 report --reporter=lcov",
"coveralls": "c8 report --reporter=text-lcov | coveralls",
"build:tsc": "esbuild ./src/start.ts --bundle --platform=node --outfile=lib/start.cjs --minify --tree-shaking=true --sourcemap=inline",
"build:es": "esbuild ./src/start.ts --bundle --platform=node --outfile=lib/start.cjs --minify --tree-shaking=true --sourcemap=inline",
"build:jobs": "find ./src/external-jobs -maxdepth 1 -type f -exec bash -c 'esbuild {} --bundle --platform=node --outfile=lib/external-jobs/$(basename {} .ts).cjs --minify --tree-shaking=true --sourcemap=inline' \\;",
"build:clean": "rimraf lib",
"build": "npm-run-all lint build:clean build:tsc build:jobs"
"copy:bullboard-ui-static": "npx copyfiles -u 1 \"./node_modules/@bull-board/ui/dist/**/*\" ./lib",
"build": "npm-run-all lint build:clean build:es build:jobs copy:bullboard-ui-static"
},
"engines": {
"node": ">= 20.8.0"
Expand Down
9 changes: 9 additions & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,19 @@ export class Worker {
createBullBoard({
queues,
serverAdapter,
options: {
uiBasePath: cfg.get('bull:board:path'),
uiConfig: {}
}
});

// since node_modules is not copied for ESM bundle support bull-board static files
// are copied inside lib
const viewsPath = './lib/@bull-board/ui/dist';
this.app = express();
serverAdapter.setBasePath(cfg.get('bull:board:path'));
serverAdapter.setViewsPath(viewsPath).setStaticPath('/static', viewsPath.concat('/static'));

this.app.use(cfg.get('bull:board:path'), serverAdapter.getRouter());
this.bullBoardServer = this.app.listen(cfg.get('bull:board:port'), () => {
logger.info(`Bull board listening on port ${cfg.get('bull:board:port')} at ${cfg.get('bull:board:path')}`);
Expand Down

0 comments on commit c0502f2

Please sign in to comment.