feat: 添加短信发送限流、忽略爬虫、调整默认限流规则

This commit is contained in:
2025-12-18 11:48:40 +08:00
parent 2df5027c0f
commit d6bf4d3cb3
2 changed files with 7 additions and 3 deletions

View File

@@ -30,9 +30,10 @@ import { SmsModule } from './sms/sms.module';
synchronize: process.env.NODE_ENV !== 'production', // Set to false in production
}),
ThrottlerModule.forRoot({
ignoreUserAgents: [/googlebot/i, /bingbot/i],
throttlers: [
{
limit: 1000,
limit: 100,
ttl: 60000, // 1 minute
},
],
@@ -51,4 +52,4 @@ import { SmsModule } from './sms/sms.module';
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
export class AppModule { }