mirror of
https://github.com/docmost/docmost.git
synced 2026-05-23 18:52:43 +08:00
fix collab module
This commit is contained in:
@@ -2,6 +2,7 @@ import { Module } from '@nestjs/common';
|
|||||||
import { AppController } from '../../app.controller';
|
import { AppController } from '../../app.controller';
|
||||||
import { AppService } from '../../app.service';
|
import { AppService } from '../../app.service';
|
||||||
import { EnvironmentModule } from '../../integrations/environment/environment.module';
|
import { EnvironmentModule } from '../../integrations/environment/environment.module';
|
||||||
|
import { EnvironmentService } from '../../integrations/environment/environment.service';
|
||||||
import { CollaborationModule } from '../collaboration.module';
|
import { CollaborationModule } from '../collaboration.module';
|
||||||
import { DatabaseModule } from '@docmost/db/database.module';
|
import { DatabaseModule } from '@docmost/db/database.module';
|
||||||
import { QueueModule } from '../../integrations/queue/queue.module';
|
import { QueueModule } from '../../integrations/queue/queue.module';
|
||||||
@@ -12,6 +13,8 @@ import { LoggerModule } from '../../common/logger/logger.module';
|
|||||||
import { RedisModule } from '@nestjs-labs/nestjs-ioredis';
|
import { RedisModule } from '@nestjs-labs/nestjs-ioredis';
|
||||||
import { RedisConfigService } from '../../integrations/redis/redis-config.service';
|
import { RedisConfigService } from '../../integrations/redis/redis-config.service';
|
||||||
import { CaslModule } from '../../core/casl/casl.module';
|
import { CaslModule } from '../../core/casl/casl.module';
|
||||||
|
import { CacheModule } from '@nestjs/cache-manager';
|
||||||
|
import KeyvRedis from '@keyv/redis';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -26,6 +29,18 @@ import { CaslModule } from '../../core/casl/casl.module';
|
|||||||
RedisModule.forRootAsync({
|
RedisModule.forRootAsync({
|
||||||
useClass: RedisConfigService,
|
useClass: RedisConfigService,
|
||||||
}),
|
}),
|
||||||
|
CacheModule.registerAsync({
|
||||||
|
isGlobal: true,
|
||||||
|
useFactory: async (environmentService: EnvironmentService) => {
|
||||||
|
const redisUrl = environmentService.getRedisUrl();
|
||||||
|
|
||||||
|
return {
|
||||||
|
ttl: 5 * 1000,
|
||||||
|
stores: [new KeyvRedis(redisUrl)],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
inject: [EnvironmentService],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
controllers: [
|
controllers: [
|
||||||
AppController,
|
AppController,
|
||||||
|
|||||||
Reference in New Issue
Block a user