There was an error while loading. Please reload this page.
1 parent 52be76c commit 75995cbCopy full SHA for 75995cb
1 file changed
packages/db/src/buffers/profile-buffer.ts
@@ -59,8 +59,19 @@ export class ProfileBuffer extends BaseBuffer {
59
return getSafeJson<IClickhouseProfile>(cached);
60
}
61
62
- async add(profile: IClickhouseProfile, _isFromEvent = false) {
+ async add(profile: IClickhouseProfile, isFromEvent = false) {
63
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
+
75
const result = await this.redis
76
.multi()
77
.rpush(this.redisKey, JSON.stringify(profile))
0 commit comments