Skip to content

Commit

Permalink
Merge pull request #134 from IGAQ/ian-cache-fix
Browse files Browse the repository at this point in the history
Increasing cache size
  • Loading branch information
iliaamiri authored Dec 2, 2022
2 parents 2c03c24 + 67da0c2 commit 2aefc2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class AutoModerationService implements IAutoModerationService {

// if moderation failed, throw error
if (hateSpeechResponseDto.class === "flag") {
if (hateSpeechResponseDto.confidence >= 0.92) {
if (hateSpeechResponseDto.confidence >= 0.9001) {
// TODO: create a ticket for the admin to review

await user.addWasOffendingRecord(
Expand Down
6 changes: 4 additions & 2 deletions src/posts/controllers/posts.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class PostsController {

@Get("/queery")
@UseGuards(OptionalJwtAuthGuard)
@CacheTTL(5)
@CacheTTL(10)
@UseInterceptors(CacheInterceptor)
public async getAllQueeries(@AuthedUser() user: User): Promise<PostModel[]> {
const queeries = await this._postsService.findAllQueeries();
Expand All @@ -96,7 +96,7 @@ export class PostsController {

@Get("/story")
@UseGuards(OptionalJwtAuthGuard)
@CacheTTL(5)
@CacheTTL(10)
@UseInterceptors(CacheInterceptor)
public async getAllStories(@AuthedUser() user: User): Promise<PostModel[]> {
const stories = await this._postsService.findAllStories();
Expand Down Expand Up @@ -125,6 +125,7 @@ export class PostsController {
}

@Get("/:postId")
@CacheTTL(10)
@UseGuards(OptionalJwtAuthGuard)
public async getPostById(
@AuthedUser() user: User,
Expand All @@ -135,6 +136,7 @@ export class PostsController {
}

@Get("/user/:userId")
@CacheTTL(20)
@UseGuards(AuthGuard("jwt"))
public async getPostsByUserId(
@AuthedUser() user: User,
Expand Down

0 comments on commit 2aefc2a

Please sign in to comment.