Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@beincom/dto",
"version": "4.4.4",
"version": "4.4.5",
"description": "Share dto for all projects of Beincom",
"main": "./dist/index.js",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions src/shared-cache/shared-group-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,13 @@ export class SharedGroupCacheKey {
userId,
].join(':');
}

public static seenStatusOfUserForNewInvitations(userId: string): string {
return [
SharedGroupCacheKey.PREFIX,
SharedGroupCacheKey.hashTag,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hashtag này để chỉ định node trong memoryDb (cái con mà lưu shared_group) do xài MemoryDb thì AWS nó bắt chạy cluster, mà mình chỉ có 1 node thôi. Còn cache xài riêng cho mỗi service thì lưu ở Elasticache, ko có cluster, nên ko cần hashtag. Dùng MemoryDb để lưu shared data xài chung cho các service do nó đảm bảo data sẽ ko mất, còn Elasticache thì mình lưu tạm bợ (có set expire).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache này xài cho 1 mình service mình thôi nên ko cần lưu vô package chung nha, prefix thì mình có biến REDIS_CACHE_PREFIX rồi.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc anh @quochung-bic review cái review này ổn ko nha

CACHE_KEYS.SEEN_STATUS_OF_USER_FOR_NEW_INVITATIONS,
userId,
].join(':');
}
}
Loading