forked from MergeFi/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidempotency.module.ts
More file actions
19 lines (18 loc) · 825 Bytes
/
Copy pathidempotency.module.ts
File metadata and controls
19 lines (18 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Global, Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { IdempotencyKey } from '../entities/idempotency-key.entity';
import { IdempotencyCleanupService } from './idempotency-cleanup.service';
import { IdempotencyInterceptor } from './idempotency.interceptor';
/**
* Global so `@Idempotent(scope)` (which references IdempotencyInterceptor
* by class, not instance) resolves from any feature module's controllers
* without each of them having to import this module individually — see
* bounties/escrow/milestones/maintenance-pool controllers (#16).
*/
@Global()
@Module({
imports: [TypeOrmModule.forFeature([IdempotencyKey])],
providers: [IdempotencyInterceptor, IdempotencyCleanupService],
exports: [IdempotencyInterceptor],
})
export class IdempotencyModule {}