mirror of
https://github.com/docmost/docmost.git
synced 2026-05-09 15:53:10 +08:00
fb27282886
* feat: make space slug editable * feat: delete space * client
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { Global, Module } from '@nestjs/common';
|
|
import { BullModule } from '@nestjs/bullmq';
|
|
import { EnvironmentService } from '../environment/environment.service';
|
|
import { createRetryStrategy, parseRedisUrl } from '../../common/helpers';
|
|
import { QueueName } from './constants';
|
|
|
|
@Global()
|
|
@Module({
|
|
imports: [
|
|
BullModule.forRootAsync({
|
|
useFactory: (environmentService: EnvironmentService) => {
|
|
const redisConfig = parseRedisUrl(environmentService.getRedisUrl());
|
|
return {
|
|
connection: {
|
|
host: redisConfig.host,
|
|
port: redisConfig.port,
|
|
password: redisConfig.password,
|
|
retryStrategy: createRetryStrategy(),
|
|
},
|
|
defaultJobOptions: {
|
|
attempts: 3,
|
|
backoff: {
|
|
type: 'exponential',
|
|
delay: 10000,
|
|
},
|
|
},
|
|
};
|
|
},
|
|
inject: [EnvironmentService],
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.EMAIL_QUEUE,
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.ATTACHEMENT_QUEUE,
|
|
}),
|
|
],
|
|
exports: [BullModule],
|
|
})
|
|
export class QueueModule {}
|