diff --git a/apps/canonical-bridge-server/src/app.module.ts b/apps/canonical-bridge-server/src/app.module.ts index 41c71733..0762c0b1 100644 --- a/apps/canonical-bridge-server/src/app.module.ts +++ b/apps/canonical-bridge-server/src/app.module.ts @@ -14,7 +14,7 @@ import { AllExceptionFilter } from './common/filters/all-exception.filter'; import { HttpExceptionFilter } from './common/filters/http-exception.filter'; import { TransformInterceptor } from './common/interceptors/transform.interceptor'; import { TimeoutInterceptor } from './common/interceptors/timeout.interceptor'; -import { REDIS_HOST, REDIS_PORT, TIME } from './common/constants'; +import { REDIS_HOST, REDIS_PORT } from './common/constants'; import { TokenModule } from './module/token/token.module'; import { BullModule } from '@nestjs/bullmq'; import { Web3Module } from '@/shared/web3/web3.module'; @@ -32,7 +32,6 @@ import { BridgeModule } from '@/module/bridge/bridge.module'; HealthModule, ScheduleModule.forRoot(), CacheModule.register({ - ttl: TIME.DAY, isGlobal: true, store: () => redisStore({ host: REDIS_HOST, port: REDIS_PORT }), }), diff --git a/apps/canonical-bridge-server/src/module/bridge/bridge.processor.ts b/apps/canonical-bridge-server/src/module/bridge/bridge.processor.ts index 8c8d5501..e38e5242 100644 --- a/apps/canonical-bridge-server/src/module/bridge/bridge.processor.ts +++ b/apps/canonical-bridge-server/src/module/bridge/bridge.processor.ts @@ -1,4 +1,4 @@ -import { CACHE_KEY, Queues, Tasks, TIME } from '@/common/constants'; +import { CACHE_KEY, Queues, Tasks } from '@/common/constants'; import { Processor, WorkerHost } from '@nestjs/bullmq'; import { Inject, Logger } from '@nestjs/common'; import { Job } from 'bullmq'; @@ -45,24 +45,24 @@ export class BridgeProcessor extends WorkerHost { const data = { chains: config.chains, tokens: tokenMap }; - await this.cache.set(`${CACHE_KEY.DEBRIDGE_CONFIG}`, data, TIME.DAY); + await this.cache.set(`${CACHE_KEY.DEBRIDGE_CONFIG}`, data); } async fetchCBridge() { const config = await this.web3Service.getTransferConfigsForAll(); if (!config) return; - await this.cache.set(`${CACHE_KEY.CBRIDGE_CONFIG}`, config, TIME.DAY); + await this.cache.set(`${CACHE_KEY.CBRIDGE_CONFIG}`, config); } async fetchStargate() { const config = await this.web3Service.getStargateConfigs(); if (!config) return; - await this.cache.set(`${CACHE_KEY.STARGATE_CONFIG}`, config, TIME.DAY); + await this.cache.set(`${CACHE_KEY.STARGATE_CONFIG}`, config); } async fetchMeson() { const config = await this.web3Service.getMesonConfigs(); if (!config) return; - await this.cache.set(`${CACHE_KEY.MESON_CONFIG}`, config, TIME.DAY); + await this.cache.set(`${CACHE_KEY.MESON_CONFIG}`, config); } } diff --git a/apps/canonical-bridge-server/src/module/token/token.processor.ts b/apps/canonical-bridge-server/src/module/token/token.processor.ts index e632efd2..f91b5367 100644 --- a/apps/canonical-bridge-server/src/module/token/token.processor.ts +++ b/apps/canonical-bridge-server/src/module/token/token.processor.ts @@ -1,6 +1,6 @@ import { InjectQueue, Processor, WorkerHost } from '@nestjs/bullmq'; import { Inject, Logger } from '@nestjs/common'; -import { CACHE_KEY, JOB_KEY, Queues, Tasks, TIME, TOKEN_REQUEST_LIMIT } from '@/common/constants'; +import { CACHE_KEY, JOB_KEY, Queues, Tasks, TOKEN_REQUEST_LIMIT } from '@/common/constants'; import { Job, Queue } from 'bullmq'; import { ITokenJob } from '@/module/token/token.interface'; import { Web3Service } from '@/shared/web3/web3.service'; @@ -57,7 +57,7 @@ export class TokenProcessor extends WorkerHost { return r; }, {}); - await this.cache.set(`${CACHE_KEY.LLAMA_CONFIG}`, config, TIME.MONTH); + await this.cache.set(`${CACHE_KEY.LLAMA_CONFIG}`, config); return config; } @@ -79,7 +79,7 @@ export class TokenProcessor extends WorkerHost { return r; }, {}); - await this.cache.set(`${CACHE_KEY.CMC_CONFIG}`, config, TIME.MONTH); + await this.cache.set(`${CACHE_KEY.CMC_CONFIG}`, config); return config; } @@ -101,7 +101,7 @@ export class TokenProcessor extends WorkerHost { {} as Record, ); - await this.cache.set(`${CACHE_KEY.PLATFORM_MAPPING}`, mapping, TIME.MONTH); + await this.cache.set(`${CACHE_KEY.PLATFORM_MAPPING}`, mapping); this.tokenService.syncCoingeckoTokens(coins, platforms); }