Browse Source

fix redis-cache.service and keyv/redis version

pull/4270/merge^2
HarukaKishida 4 weeks ago
parent
commit
c809719fca
  1. 8
      apps/api/src/app/redis-cache/redis-cache.service.ts
  2. 2
      package-lock.json
  3. 2
      package.json

8
apps/api/src/app/redis-cache/redis-cache.service.ts

@ -21,10 +21,9 @@ export class RedisCacheService {
public async getKeys(aPrefix?: string): Promise<string[]> {
const prefix = aPrefix;
const keyList = [];
this.cache.stores[0].iterator((key) => {
if (prefix && key.startsWith(prefix)) {
keyList.push(key);
} else if (!prefix) {
if ((prefix && key.startsWith(prefix)) || !prefix) {
keyList.push(key);
}
});
@ -58,9 +57,8 @@ export class RedisCacheService {
public async isHealthy() {
try {
const client = this.cache.stores[0];
const isHealthy = await Promise.race([
client.ttl,
this.getKeys(),
new Promise((_, reject) =>
setTimeout(
() => reject(new Error('Redis health check timeout')),

2
package-lock.json

@ -30,7 +30,7 @@
"@dfinity/principal": "0.15.7",
"@dinero.js/currencies": "2.0.0-alpha.8",
"@internationalized/number": "3.6.0",
"@keyv/redis": "^4.2.0",
"@keyv/redis": "^4.3.1",
"@nestjs/bull": "11.0.1",
"@nestjs/cache-manager": "3.0.0",
"@nestjs/common": "11.0.6",

2
package.json

@ -76,7 +76,7 @@
"@dfinity/principal": "0.15.7",
"@dinero.js/currencies": "2.0.0-alpha.8",
"@internationalized/number": "3.6.0",
"@keyv/redis": "^4.2.0",
"@keyv/redis": "^4.3.1",
"@nestjs/bull": "11.0.1",
"@nestjs/cache-manager": "3.0.0",
"@nestjs/common": "11.0.6",

Loading…
Cancel
Save