switched proxy and batch to new redis

This commit is contained in:
Boki 2025-06-10 13:52:06 -04:00
parent e98b1d8ae2
commit a86367bec5
3 changed files with 29 additions and 521 deletions

View file

@ -1,5 +1,5 @@
import { getLogger } from '@stock-bot/logger';
import createCache, { type CacheProvider } from '@stock-bot/cache';
import { createCache, type CacheProvider } from '@stock-bot/cache';
import { HttpClient, ProxyInfo } from '@stock-bot/http';
import pLimit from 'p-limit';
@ -110,8 +110,7 @@ async function resetProxyStats(): Promise<void> {
async function initializeSharedResources() {
if (!logger) {
logger = getLogger('proxy-tasks');
cache = createCache('hybrid', {
name: 'proxy-tasks',
cache = createCache({
keyPrefix: 'proxy:',
ttl: PROXY_CONFIG.CACHE_TTL,
enableMetrics: true