Skip to content

Commit 554547a

Browse files
committed
refactor: update throttler configuration for improved rate limiting
1 parent 5e07e4e commit 554547a

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

server/src/app.module.ts

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,20 @@ import { UserModule } from './user/user.module';
6666
}),
6767
// Throttler
6868
ThrottlerModule.forRoot([
69-
{
70-
name: 'global',
71-
ttl: 60 * 1000, // 1 minute
72-
limit: 200, // 200 requests per minute
73-
},
7469
{
7570
name: 'short',
76-
ttl: 1000, // 1 second
77-
limit: 5,
71+
ttl: 1000,
72+
limit: 3,
7873
},
7974
{
8075
name: 'medium',
81-
ttl: 60 * 1000, // 1 minute
82-
limit: 100,
76+
ttl: 10000,
77+
limit: 20,
8378
},
8479
{
8580
name: 'long',
86-
ttl: 60 * 60 * 100, // 1 hour
87-
limit: 1000,
88-
},
89-
// one every 15 minutes
90-
{
91-
name: 'very-long',
92-
ttl: 15 * 60 * 1000,
93-
limit: 1,
94-
},
95-
// one every 1 hour
96-
{
97-
name: 'super-long',
98-
ttl: 60 * 60 * 1000,
99-
limit: 1,
81+
ttl: 60000,
82+
limit: 100,
10083
},
10184
]),
10285
SongModule,

0 commit comments

Comments
 (0)