test
This commit is contained in:
@@ -59,8 +59,19 @@ export class ProfileBuffer extends BaseBuffer {
|
|||||||
return getSafeJson<IClickhouseProfile>(cached);
|
return getSafeJson<IClickhouseProfile>(cached);
|
||||||
}
|
}
|
||||||
|
|
||||||
async add(profile: IClickhouseProfile, _isFromEvent = false) {
|
async add(profile: IClickhouseProfile, isFromEvent = false) {
|
||||||
try {
|
try {
|
||||||
|
if (isFromEvent) {
|
||||||
|
const cacheKey = this.getProfileCacheKey({
|
||||||
|
profileId: profile.id,
|
||||||
|
projectId: profile.project_id,
|
||||||
|
});
|
||||||
|
const exists = await this.redis.exists(cacheKey);
|
||||||
|
if (exists === 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const result = await this.redis
|
const result = await this.redis
|
||||||
.multi()
|
.multi()
|
||||||
.rpush(this.redisKey, JSON.stringify(profile))
|
.rpush(this.redisKey, JSON.stringify(profile))
|
||||||
|
|||||||
Reference in New Issue
Block a user