Skip to content

Commit

Permalink
upgrade-express-ex: upgrade express example (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivnnv authored Nov 20, 2023
1 parent 9ce2f63 commit 37a618f
Show file tree
Hide file tree
Showing 3 changed files with 453 additions and 214 deletions.
7 changes: 1 addition & 6 deletions examples/with-express/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { createBullBoard } = require('@bull-board/api');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');
const { ExpressAdapter } = require('@bull-board/express');
const { Queue: QueueMQ, Worker, QueueScheduler } = require('bullmq');
const { Queue: QueueMQ, Worker } = require('bullmq');
const express = require('express');

const sleep = (t) => new Promise((resolve) => setTimeout(resolve, t * 1000));
Expand All @@ -16,11 +16,6 @@ const redisOptions = {
const createQueueMQ = (name) => new QueueMQ(name, { connection: redisOptions });

async function setupBullMQProcessor(queueName) {
const queueScheduler = new QueueScheduler(queueName, {
connection: redisOptions,
});
await queueScheduler.waitUntilReady();

new Worker(queueName, async (job) => {
for (let i = 0; i <= 100; i++) {
await sleep(Math.random());
Expand Down
6 changes: 3 additions & 3 deletions examples/with-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"author": "felixmosh",
"license": "ISC",
"dependencies": {
"@bull-board/express": "^3.10.4",
"bullmq": "^4.6.0",
"express": "^4.17.3"
"@bull-board/express": "^5.9.1",
"bullmq": "^4.14.0",
"express": "^4.18.2"
}
}
Loading

0 comments on commit 37a618f

Please sign in to comment.