feat: add EventEmitterModule to AppModule

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-09-22 22:08:23 +02:00 committed by David Mehren
parent 35149e8a42
commit 77615f0878
2 changed files with 13 additions and 0 deletions

View file

@ -5,6 +5,7 @@
*/
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { ScheduleModule } from '@nestjs/schedule';
import { TypeOrmModule } from '@nestjs/typeorm';
import { RouterModule, Routes } from 'nest-router';
@ -22,6 +23,7 @@ import externalConfig from './config/external-services.config';
import hstsConfig from './config/hsts.config';
import mediaConfig from './config/media.config';
import noteConfig from './config/note.config';
import { eventModuleConfig } from './events';
import { FrontendConfigModule } from './frontend-config/frontend-config.module';
import { FrontendConfigService } from './frontend-config/frontend-config.service';
import { GroupsModule } from './groups/groups.module';
@ -87,6 +89,7 @@ const routes: Routes = [
],
isGlobal: true,
}),
EventEmitterModule.forRoot(eventModuleConfig),
ScheduleModule.forRoot(),
NotesModule,
UsersModule,

View file

@ -4,6 +4,16 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
export const eventModuleConfig = {
wildcard: false,
delimiter: '.',
newListener: false,
removeListener: false,
maxListeners: 10,
verboseMemoryLeak: true,
ignoreErrors: false,
};
export enum NoteEvent {
PERMISSION_CHANGE = 'note.permission_change',
DELETION = 'note.deletion',