I'm splitting a module into two controllers and im having issue with onModuleInit being called:
@UseGuards(AuthGuard, AclGuard)
@ApiTags('scripts')
@Controller('project/:project/scripts')
export class ProjectScriptController implements OnModuleInit {
private scriptService: script_service.ScriptService;
constructor(
@Inject('SCRIPT_SERVICE') private readonly client: ClientGrpc,
private readonly projectService: ProjectService,
) {}
onModuleInit() {
this.scriptService =
this.client.getService<script_service.ScriptService>('ScriptService');
}
and ```ts
@UseGuards(AuthGuard, AclGuard)
@ApiTags('scripts')
@Controller('script')
export class ScriptsController implements OnModuleInit {
private scriptService: script_service.ScriptService;
constructor(
@Inject('SCRIPT_SERVICE') private readonly client: ClientGrpc,
private readonly projectService: ProjectService,
) {}
onModuleInit() {
this.scriptService =
this.client.getService<script_service.ScriptService>('ScriptService');
}
only one is called