mirror of
https://github.com/docmost/docmost.git
synced 2026-07-12 13:04:46 +10:00
6d024fc3de
* refactor imports - WIP * Add readstream * WIP * fix attachmentId render * fix attachmentId render * turndown video tag * feat: add stream upload support and improve file handling - Add stream upload functionality to storage drivers\n- Improve ZIP file extraction with better encoding handling\n- Fix attachment ID rendering issues\n- Add AWS S3 upload stream support\n- Update dependencies for better compatibility * WIP * notion formatter * move embed parser to editor-ext package * import embeds * utility files * cleanup * Switch from happy-dom to cheerio * Refine code * WIP * bug fixes and UI * sync * WIP * sync * keep import modal mounted * Show modal during upload * WIP * WIP
65 lines
1.8 KiB
TypeScript
65 lines
1.8 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';
|
|
import { BacklinksProcessor } from './processors/backlinks.processor';
|
|
|
|
@Global()
|
|
@Module({
|
|
imports: [
|
|
BullModule.forRootAsync({
|
|
useFactory: (environmentService: EnvironmentService) => {
|
|
const redisConfig = parseRedisUrl(environmentService.getRedisUrl());
|
|
return {
|
|
connection: {
|
|
host: redisConfig.host,
|
|
port: redisConfig.port,
|
|
password: redisConfig.password,
|
|
db: redisConfig.db,
|
|
family: redisConfig.family,
|
|
retryStrategy: createRetryStrategy(),
|
|
},
|
|
defaultJobOptions: {
|
|
attempts: 3,
|
|
backoff: {
|
|
type: 'exponential',
|
|
delay: 20 * 1000,
|
|
},
|
|
removeOnComplete: {
|
|
count: 200,
|
|
},
|
|
removeOnFail: {
|
|
count: 100,
|
|
},
|
|
},
|
|
};
|
|
},
|
|
inject: [EnvironmentService],
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.EMAIL_QUEUE,
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.ATTACHMENT_QUEUE,
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.GENERAL_QUEUE,
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.BILLING_QUEUE,
|
|
}),
|
|
BullModule.registerQueue({
|
|
name: QueueName.FILE_TASK_QUEUE,
|
|
defaultJobOptions: {
|
|
removeOnComplete: true,
|
|
removeOnFail: true,
|
|
attempts: 1,
|
|
},
|
|
}),
|
|
],
|
|
exports: [BullModule],
|
|
providers: [BacklinksProcessor],
|
|
})
|
|
export class QueueModule {}
|