Skip to content

Commit 75995cb

Browse files
committed
test
1 parent 52be76c commit 75995cb

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

packages/db/src/buffers/profile-buffer.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,19 @@ export class ProfileBuffer extends BaseBuffer {
5959
return getSafeJson<IClickhouseProfile>(cached);
6060
}
6161

62-
async add(profile: IClickhouseProfile, _isFromEvent = false) {
62+
async add(profile: IClickhouseProfile, isFromEvent = false) {
6363
try {
64+
if (isFromEvent) {
65+
const cacheKey = this.getProfileCacheKey({
66+
profileId: profile.id,
67+
projectId: profile.project_id,
68+
});
69+
const exists = await this.redis.exists(cacheKey);
70+
if (exists === 1) {
71+
return;
72+
}
73+
}
74+
6475
const result = await this.redis
6576
.multi()
6677
.rpush(this.redisKey, JSON.stringify(profile))

0 commit comments

Comments
 (0)