Skip to content

Commit

Permalink
fix: Connections config
Browse files Browse the repository at this point in the history
  • Loading branch information
fhugoduarte committed Jan 20, 2021
1 parent 855f454 commit b5b3c9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/BullManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
BullManagerContract,
JobContract,
QueueContract,
BullConnectionContract
BullConfig
} from '@ioc:Rocketseat/Bull'
import {
Queue,
Expand All @@ -20,7 +20,7 @@ export class BullManager implements BullManagerContract {
constructor (
protected container: IocContract,
protected Logger: LoggerContract,
protected config: BullConnectionContract,
protected config: BullConfig,
protected jobs: string[]
) {}

Expand All @@ -37,7 +37,7 @@ export class BullManager implements BullManagerContract {

queues[jobDefinition.key] = Object.freeze({
bull: new Queue(jobDefinition.key, {
connection: this.config,
connection: this.config.connections[this.config.connection],
...jobDefinition.queueOptions
}),
...jobDefinition,
Expand Down Expand Up @@ -85,7 +85,7 @@ export class BullManager implements BullManagerContract {

public ui (port = 9999) {
BullBoard.setQueues(
Object.keys(this.queues).map((key) => this.getByKey(key).bull)
Object.keys(this.queues).map((key) => new BullBoard.BullMQAdapter(this.getByKey(key).bull))
)

const server = BullBoard.router.listen(port, () => {
Expand Down Expand Up @@ -113,7 +113,7 @@ export class BullManager implements BullManagerContract {

const workerOptions: WorkerOptions = {
concurrency: jobDefinition.concurrency ?? 1,
connection: this.config,
connection: this.config.connections[this.config.connection],
...jobDefinition.workerOptions
}

Expand Down

0 comments on commit b5b3c9e

Please sign in to comment.