diff --git a/backend/src/api/rbf-cache.ts b/backend/src/api/rbf-cache.ts index b5592252c..3f39cd58e 100644 --- a/backend/src/api/rbf-cache.ts +++ b/backend/src/api/rbf-cache.ts @@ -53,7 +53,7 @@ class RbfCache { private expiring: Map = new Map(); private cacheQueue: CacheEvent[] = []; - constructor() { + public init(): void { setInterval(this.cleanup.bind(this), 1000 * 60 * 10); } diff --git a/backend/src/index.ts b/backend/src/index.ts index 9d0fa07f5..fc6f655dc 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -43,6 +43,7 @@ import { AxiosError } from 'axios'; import v8 from 'v8'; import { formatBytes, getBytesUnit } from './utils/format'; import redisCache from './api/redis-cache'; +import rbfCache from './api/rbf-cache'; class Server { private wss: WebSocket.Server | undefined; @@ -107,6 +108,8 @@ class Server { } } + rbfCache.init(); + this.app .use((req: Request, res: Response, next: NextFunction) => { res.setHeader('Access-Control-Allow-Origin', '*');