You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
576 B
18 lines
576 B
import { BullModuleOptions, SharedBullConfigurationFactory } from "@nestjs/bull";
|
|
import { Injectable } from "@nestjs/common";
|
|
import { ConfigService } from "@nestjs/config";
|
|
|
|
@Injectable()
|
|
export class BullConfigService implements SharedBullConfigurationFactory {
|
|
constructor(private readonly configService: ConfigService) {
|
|
}
|
|
|
|
createSharedConfiguration(): BullModuleOptions {
|
|
return {
|
|
redis: {
|
|
host: this.configService.getOrThrow('BULL_REDIS_HOST'),
|
|
port: parseInt(this.configService.getOrThrow('BULL_REDIS_PORT'), 10),
|
|
},
|
|
};
|
|
}
|
|
}
|
|
|