From 0fc83486dc17c69304ea474db59c95d634f9f1ed Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:57:26 +0200 Subject: [PATCH] Feature/improve redis cache (#3714) * Improve redis cache * Update changelog --- CHANGELOG.md | 5 + .../interfaces/redis-cache.interface.ts | 7 - .../interfaces/redis-store.interface.ts | 8 - .../src/app/redis-cache/redis-cache.module.ts | 16 +- .../redis-cache/redis-cache.service.mock.ts | 4 +- .../app/redis-cache/redis-cache.service.ts | 10 +- .../configuration/configuration.service.ts | 3 +- .../interfaces/environment.interface.ts | 1 - package-lock.json | 220 ++++++++++++------ package.json | 8 +- 10 files changed, 176 insertions(+), 106 deletions(-) delete mode 100644 apps/api/src/app/redis-cache/interfaces/redis-cache.interface.ts delete mode 100644 apps/api/src/app/redis-cache/interfaces/redis-store.interface.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 33705879f..fb764589e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reworked the portfolio calculator - Exposed the log levels as an environment variable (`LOG_LEVELS`) - Exposed the maximum of chart data items as an environment variable (`MAX_CHART_ITEMS`) +- Changed the data format of the environment variable `CACHE_QUOTES_TTL` from seconds to milliseconds +- Changed the data format of the environment variable `CACHE_TTL` from seconds to milliseconds +- Removed the environment variable `MAX_ITEM_IN_CACHE` - Improved the language localization for Polish (`pl`) +- Migrated from `cache-manager-redis-store` to `cache-manager-redis-yet` +- Upgraded `cache-manager` from version `3.4.3` to `5.7.6` ### Fixed diff --git a/apps/api/src/app/redis-cache/interfaces/redis-cache.interface.ts b/apps/api/src/app/redis-cache/interfaces/redis-cache.interface.ts deleted file mode 100644 index 194da0bc8..000000000 --- a/apps/api/src/app/redis-cache/interfaces/redis-cache.interface.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Cache } from 'cache-manager'; - -import type { RedisStore } from './redis-store.interface'; - -export interface RedisCache extends Cache { - store: RedisStore; -} diff --git a/apps/api/src/app/redis-cache/interfaces/redis-store.interface.ts b/apps/api/src/app/redis-cache/interfaces/redis-store.interface.ts deleted file mode 100644 index 2ad5df485..000000000 --- a/apps/api/src/app/redis-cache/interfaces/redis-store.interface.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Store } from 'cache-manager'; -import { createClient } from 'redis'; - -export interface RedisStore extends Store { - getClient: () => ReturnType; - isCacheableValue: (value: any) => boolean; - name: 'redis'; -} diff --git a/apps/api/src/app/redis-cache/redis-cache.module.ts b/apps/api/src/app/redis-cache/redis-cache.module.ts index 4b4168168..f960ad047 100644 --- a/apps/api/src/app/redis-cache/redis-cache.module.ts +++ b/apps/api/src/app/redis-cache/redis-cache.module.ts @@ -3,31 +3,27 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration/con import { CacheModule } from '@nestjs/cache-manager'; import { Module } from '@nestjs/common'; -import * as redisStore from 'cache-manager-redis-store'; +import { redisStore } from 'cache-manager-redis-yet'; import type { RedisClientOptions } from 'redis'; import { RedisCacheService } from './redis-cache.service'; @Module({ + exports: [RedisCacheService], imports: [ - CacheModule.registerAsync({ + CacheModule.registerAsync({ imports: [ConfigurationModule], inject: [ConfigurationService], useFactory: async (configurationService: ConfigurationService) => { return { - db: configurationService.get('REDIS_DB'), - host: configurationService.get('REDIS_HOST'), - max: configurationService.get('MAX_ITEM_IN_CACHE'), - password: configurationService.get('REDIS_PASSWORD'), - port: configurationService.get('REDIS_PORT'), store: redisStore, - ttl: configurationService.get('CACHE_TTL') + ttl: configurationService.get('CACHE_TTL'), + url: `redis://:${configurationService.get('REDIS_PASSWORD')}@${configurationService.get('REDIS_HOST')}:${configurationService.get('REDIS_PORT')}/${configurationService.get('REDIS_DB')}` }; } }), ConfigurationModule ], - providers: [RedisCacheService], - exports: [RedisCacheService] + providers: [RedisCacheService] }) export class RedisCacheModule {} diff --git a/apps/api/src/app/redis-cache/redis-cache.service.mock.ts b/apps/api/src/app/redis-cache/redis-cache.service.mock.ts index 2422e88ab..094c7e6a0 100644 --- a/apps/api/src/app/redis-cache/redis-cache.service.mock.ts +++ b/apps/api/src/app/redis-cache/redis-cache.service.mock.ts @@ -1,4 +1,4 @@ -import { RedisCacheService } from './redis-cache.service'; +import { Milliseconds } from 'cache-manager'; export const RedisCacheServiceMock = { get: (key: string): Promise => { @@ -7,7 +7,7 @@ export const RedisCacheServiceMock = { getPortfolioSnapshotKey: (userId: string): string => { return `portfolio-snapshot-${userId}`; }, - set: (key: string, value: string, ttlInSeconds?: number): Promise => { + set: (key: string, value: string, ttl?: Milliseconds): Promise => { return Promise.resolve(value); } }; diff --git a/apps/api/src/app/redis-cache/redis-cache.service.ts b/apps/api/src/app/redis-cache/redis-cache.service.ts index 341dc4acf..c972c30a1 100644 --- a/apps/api/src/app/redis-cache/redis-cache.service.ts +++ b/apps/api/src/app/redis-cache/redis-cache.service.ts @@ -4,17 +4,17 @@ import { AssetProfileIdentifier, Filter } from '@ghostfolio/common/interfaces'; import { CACHE_MANAGER } from '@nestjs/cache-manager'; import { Inject, Injectable, Logger } from '@nestjs/common'; +import { Milliseconds } from 'cache-manager'; +import { RedisCache } from 'cache-manager-redis-yet'; import { createHash } from 'crypto'; -import type { RedisCache } from './interfaces/redis-cache.interface'; - @Injectable() export class RedisCacheService { public constructor( @Inject(CACHE_MANAGER) private readonly cache: RedisCache, private readonly configurationService: ConfigurationService ) { - const client = cache.store.getClient(); + const client = cache.store.client; client.on('error', (error) => { Logger.error(error, 'RedisCacheService'); @@ -81,11 +81,11 @@ export class RedisCacheService { return this.cache.reset(); } - public async set(key: string, value: string, ttlInSeconds?: number) { + public async set(key: string, value: string, ttl?: Milliseconds) { return this.cache.set( key, value, - ttlInSeconds ?? this.configurationService.get('CACHE_TTL') + ttl ?? this.configurationService.get('CACHE_TTL') ); } } diff --git a/apps/api/src/services/configuration/configuration.service.ts b/apps/api/src/services/configuration/configuration.service.ts index 6a50766d2..4c5a60cce 100644 --- a/apps/api/src/services/configuration/configuration.service.ts +++ b/apps/api/src/services/configuration/configuration.service.ts @@ -21,7 +21,7 @@ export class ConfigurationService { API_KEY_FINANCIAL_MODELING_PREP: str({ default: '' }), API_KEY_OPEN_FIGI: str({ default: '' }), API_KEY_RAPID_API: str({ default: '' }), - CACHE_QUOTES_TTL: num({ default: ms('1 minute') / 1000 }), + CACHE_QUOTES_TTL: num({ default: ms('1 minute') }), CACHE_TTL: num({ default: 1 }), DATA_SOURCE_EXCHANGE_RATES: str({ default: DataSource.YAHOO }), DATA_SOURCE_IMPORT: str({ default: DataSource.YAHOO }), @@ -43,7 +43,6 @@ export class ConfigurationService { JWT_SECRET_KEY: str({}), MAX_ACTIVITIES_TO_IMPORT: num({ default: Number.MAX_SAFE_INTEGER }), MAX_CHART_ITEMS: num({ default: 365 }), - MAX_ITEM_IN_CACHE: num({ default: 9999 }), PORT: port({ default: 3333 }), REDIS_DB: num({ default: 0 }), REDIS_HOST: str({ default: 'localhost' }), diff --git a/apps/api/src/services/interfaces/environment.interface.ts b/apps/api/src/services/interfaces/environment.interface.ts index c0dfb1806..d07937787 100644 --- a/apps/api/src/services/interfaces/environment.interface.ts +++ b/apps/api/src/services/interfaces/environment.interface.ts @@ -29,7 +29,6 @@ export interface Environment extends CleanedEnvAccessors { JWT_SECRET_KEY: string; MAX_ACTIVITIES_TO_IMPORT: number; MAX_CHART_ITEMS: number; - MAX_ITEM_IN_CACHE: number; PORT: number; REDIS_DB: number; REDIS_HOST: string; diff --git a/package-lock.json b/package-lock.json index aa7ff4681..2938d915b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ghostfolio", - "version": "2.103.0", + "version": "2.106.0-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ghostfolio", - "version": "2.103.0", + "version": "2.106.0-beta.3", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { @@ -30,7 +30,7 @@ "@dinero.js/currencies": "2.0.0-alpha.8", "@internationalized/number": "3.5.2", "@nestjs/bull": "10.0.1", - "@nestjs/cache-manager": "2.1.0", + "@nestjs/cache-manager": "2.2.2", "@nestjs/common": "10.1.3", "@nestjs/config": "3.0.0", "@nestjs/core": "10.1.3", @@ -49,8 +49,8 @@ "body-parser": "1.20.2", "bootstrap": "4.6.0", "bull": "4.10.4", - "cache-manager": "3.4.3", - "cache-manager-redis-store": "2.0.0", + "cache-manager": "5.7.6", + "cache-manager-redis-yet": "5.1.4", "chart.js": "4.2.0", "chartjs-adapter-date-fns": "3.0.0", "chartjs-chart-treemap": "2.3.1", @@ -126,7 +126,7 @@ "@trivago/prettier-plugin-sort-imports": "4.3.0", "@types/big.js": "6.2.2", "@types/body-parser": "1.19.5", - "@types/cache-manager": "3.4.2", + "@types/cache-manager": "4.0.6", "@types/color": "3.0.6", "@types/google-spreadsheet": "3.1.5", "@types/jest": "29.4.4", @@ -6800,14 +6800,14 @@ "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/@nestjs/cache-manager": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@nestjs/cache-manager/-/cache-manager-2.1.0.tgz", - "integrity": "sha512-9kep3a8Mq5cMuXN/anGhSYc0P48CRBXk5wyJJRBFxhNkCH8AIzZF4CASGVDIEMmm3OjVcEUHojjyJwCODS17Qw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@nestjs/cache-manager/-/cache-manager-2.2.2.tgz", + "integrity": "sha512-+n7rpU1QABeW2WV17Dl1vZCG3vWjJU1MaamWgZvbGxYE9EeCM0lVLfw3z7acgDTNwOy+K68xuQPoIMxD0bhjlA==", + "license": "MIT", "peerDependencies": { "@nestjs/common": "^9.0.0 || ^10.0.0", "@nestjs/core": "^9.0.0 || ^10.0.0", "cache-manager": "<=5", - "reflect-metadata": "^0.1.12", "rxjs": "^7.0.0" } }, @@ -9708,6 +9708,71 @@ "@prisma/debug": "5.18.0" } }, + "node_modules/@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", + "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", + "license": "MIT", + "dependencies": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@redis/client/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/@redis/graph": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", + "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/json": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/search": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/time-series": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "license": "MIT", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.19.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.1.tgz", @@ -11468,10 +11533,11 @@ } }, "node_modules/@types/cache-manager": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/@types/cache-manager/-/cache-manager-3.4.2.tgz", - "integrity": "sha512-1IwA74t5ID4KWo0Kndal16MhiPSZgMe1fGc+MLT6j5r+Ab7jku36PFTl4PP6MiWw0BJscM9QpZEo00qixNQoRg==", - "dev": true + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/cache-manager/-/cache-manager-4.0.6.tgz", + "integrity": "sha512-8qL93MF05/xrzFm/LSPtzNEOE1eQF3VwGHAcQEylgp5hDSTe41jtFwbSYAPfyYcVa28y1vYSjIt0c1fLLUiC/Q==", + "dev": true, + "license": "MIT" }, "node_modules/@types/cacheable-request": { "version": "6.0.3", @@ -13255,7 +13321,8 @@ "node_modules/async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "dev": true }, "node_modules/asynckit": { "version": "0.4.0", @@ -14243,41 +14310,50 @@ } }, "node_modules/cache-manager": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-3.4.3.tgz", - "integrity": "sha512-6+Hfzy1SNs/thUwo+07pV0ozgxc4sadrAN0eFVGvXl/X9nz3J0BqEnnEoyxEn8jnF+UkEo0MKpyk9BO80hMeiQ==", - "dependencies": { - "async": "3.2.0", - "lodash": "^4.17.21", - "lru-cache": "6.0.0" - } - }, - "node_modules/cache-manager-redis-store": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cache-manager-redis-store/-/cache-manager-redis-store-2.0.0.tgz", - "integrity": "sha512-bWLWlUg6nCYHiJLCCYxY2MgvwvKnvlWwrbuynrzpjEIhfArD2GC9LtutIHFEPeyGVQN6C+WEw+P3r+BFBwhswg==", + "version": "5.7.6", + "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-5.7.6.tgz", + "integrity": "sha512-wBxnBHjDxF1RXpHCBD6HGvKER003Ts7IIm0CHpggliHzN1RZditb7rXoduE1rplc2DEFYKxhLKgFuchXMJje9w==", + "license": "MIT", "dependencies": { - "redis": "^3.0.2" + "eventemitter3": "^5.0.1", + "lodash.clonedeep": "^4.5.0", + "lru-cache": "^10.2.2", + "promise-coalesce": "^1.1.2" }, "engines": { - "node": ">= 8.3" + "node": ">= 18" } }, - "node_modules/cache-manager/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/cache-manager-redis-yet": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/cache-manager-redis-yet/-/cache-manager-redis-yet-5.1.4.tgz", + "integrity": "sha512-2mXZjo+txfH2m+mSTHTITNq8c5SssU2nP7NutzrocO3Mw/SbjHcDo+mriI3ZuR63ov/oUUIaF9iF+MzDqVzMoQ==", + "license": "MIT", "dependencies": { - "yallist": "^4.0.0" + "@redis/bloom": "^1.2.0", + "@redis/client": "^1.6.0", + "@redis/graph": "^1.1.1", + "@redis/json": "^1.0.7", + "@redis/search": "^1.2.0", + "@redis/time-series": "^1.1.0", + "cache-manager": "^5.7.6", + "redis": "^4.7.0" }, "engines": { - "node": ">=10" + "node": ">= 18" } }, - "node_modules/cache-manager/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "node_modules/cache-manager/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/cache-manager/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" }, "node_modules/cacheable-lookup": { "version": "5.0.4", @@ -19466,6 +19542,15 @@ "node": ">=10" } }, + "node_modules/generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -24555,6 +24640,12 @@ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "optional": true }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "license": "MIT" + }, "node_modules/lodash.clonedeepwith": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz", @@ -28785,6 +28876,15 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "node_modules/promise-coalesce": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/promise-coalesce/-/promise-coalesce-1.1.2.tgz", + "integrity": "sha512-zLaJ9b8hnC564fnJH6NFSOGZYYdzrAJn2JUUIwzoQb32fG2QAakpDNM+CZo1km6keXkRXRM+hml1BFAPVnPkxg==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=16" + } + }, "node_modules/promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -29125,28 +29225,22 @@ } }, "node_modules/redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", + "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", + "license": "MIT", + "workspaces": [ + "./packages/*" + ], "dependencies": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-redis" + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.0", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, - "node_modules/redis-commands": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", - "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" - }, "node_modules/redis-errors": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", @@ -29166,14 +29260,6 @@ "node": ">=4" } }, - "node_modules/redis/node_modules/denque": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", - "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", diff --git a/package.json b/package.json index ef43a39a2..f44dae34e 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@dinero.js/currencies": "2.0.0-alpha.8", "@internationalized/number": "3.5.2", "@nestjs/bull": "10.0.1", - "@nestjs/cache-manager": "2.1.0", + "@nestjs/cache-manager": "2.2.2", "@nestjs/common": "10.1.3", "@nestjs/config": "3.0.0", "@nestjs/core": "10.1.3", @@ -93,8 +93,8 @@ "body-parser": "1.20.2", "bootstrap": "4.6.0", "bull": "4.10.4", - "cache-manager": "3.4.3", - "cache-manager-redis-store": "2.0.0", + "cache-manager": "5.7.6", + "cache-manager-redis-yet": "5.1.4", "chart.js": "4.2.0", "chartjs-adapter-date-fns": "3.0.0", "chartjs-chart-treemap": "2.3.1", @@ -170,7 +170,7 @@ "@trivago/prettier-plugin-sort-imports": "4.3.0", "@types/big.js": "6.2.2", "@types/body-parser": "1.19.5", - "@types/cache-manager": "3.4.2", + "@types/cache-manager": "4.0.6", "@types/color": "3.0.6", "@types/google-spreadsheet": "3.1.5", "@types/jest": "29.4.4",