feat: redesign auction engine with redis sot

This commit is contained in:
dahyeon committed 2026-06-23 03:16:04 -07:00
1 parent 737702d78c
commit e8bb20d988
75 files changed
+12737 -542

No files matched your search

@@ -1,5 +1,5 @@
import { Injectable, Logger } from '@nestjs/common';
import { GarnetService } from '../global/garnet/garnet.service';
import { RedisService } from '../global/redis/redis.service';
const COMMUNITY_STATS_TTL_SECONDS = 5 * 60;
const COMMUNITY_STATS_DETAIL_TTL_SECONDS = 24 * 60 * 60;
@@ -8,10 +8,10 @@ const COMMUNITY_STATS_DETAIL_TTL_SECONDS = 24 * 60 * 60;
export class CommunityStatsCacheService {
private readonly logger = new Logger(CommunityStatsCacheService.name);
constructor(private readonly garnetService: GarnetService) {}
constructor(private readonly redisService: RedisService) {}
public get<T>(key: string): Promise<T | null> {
return this.garnetService.getJson<T>(key);
return this.redisService.getJson<T>(key);
}
public set(
@@ -19,7 +19,7 @@ export class CommunityStatsCacheService {
value: unknown,
ttlSeconds = COMMUNITY_STATS_TTL_SECONDS,
): Promise<void> {
return this.garnetService.setJson(key, value, ttlSeconds);
return this.redisService.setJson(key, value, ttlSeconds);
}
public setDetail(key: string, value: unknown): Promise<void> {
@@ -29,7 +29,7 @@ export class CommunityStatsCacheService {
public async invalidateCommunity(communityId: string): Promise<number> {
const prefix = `riot:communitystats:`;
const match = `${prefix}*${communityId}*`;
const client = this.garnetService.raw();
const client = this.redisService.raw();
let cursor = '0';
let deleted = 0;