Skip to content

Commit

Permalink
perf: increase TTL limit number
Browse files Browse the repository at this point in the history
resolve: #66
  • Loading branch information
buqiyuan committed Oct 4, 2024
1 parent b751a2a commit ed601a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/modules/sse/sse.controller.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { BeforeApplicationShutdown, Controller, Headers, Ip, Param, ParseIntPipe, Req, Res, Sse } from '@nestjs/common'
import { ApiOperation, ApiTags } from '@nestjs/swagger'
import { SkipThrottle } from '@nestjs/throttler'
import { FastifyReply, FastifyRequest } from 'fastify'

import { interval, Observable } from 'rxjs'

import { ApiSecurityAuth } from '~/common/decorators/swagger.decorator'

import { OnlineService } from '../system/online/online.service'

import { MessageEvent, SseService } from './sse.service'

@ApiTags('System - sse模块')
@ApiSecurityAuth()
@SkipThrottle()
@Controller('sse')
export class SseController implements BeforeApplicationShutdown {
private replyMap: Map<number, FastifyReply> = new Map()
Expand Down
2 changes: 1 addition & 1 deletion src/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { RedisModule } from './redis/redis.module'
// rate limit
ThrottlerModule.forRoot([
{
limit: 10,
limit: 20,
ttl: 60000,
},
]),
Expand Down

0 comments on commit ed601a9

Please sign in to comment.