refactor: clean aggregate cache to event

This commit is contained in:
Innei
2022-01-18 17:05:12 +08:00
parent 7320592465
commit ab796b7853
7 changed files with 36 additions and 31 deletions

View File

@@ -1,6 +1,5 @@
import IORedis from 'ioredis'
import RedisMemoryServer from 'redis-memory-server'
import { CacheKeys } from '~/constants/cache.constant'
export class MockCacheService {
private client: IORedis.Redis
@@ -23,16 +22,6 @@ export class MockCacheService {
public getClient() {
return this.redisClient
}
public clearAggregateCache() {
return Promise.all([
this.redisClient.del(CacheKeys.RSS),
this.redisClient.del(CacheKeys.RSSXmlCatch),
this.redisClient.del(CacheKeys.AggregateCatch),
this.redisClient.del(CacheKeys.SiteMapCatch),
this.redisClient.del(CacheKeys.SiteMapXmlCatch),
])
}
}
export const createMockRedis = async () => {