updated loggers to getLogger
This commit is contained in:
parent
1ccdbddb71
commit
2aaeba2f6c
16 changed files with 72 additions and 97 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Logger } from '@stock-bot/logger';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import createCache, { type CacheProvider } from '@stock-bot/cache';
|
||||
import { HttpClient, ProxyInfo } from '@stock-bot/http';
|
||||
import pLimit from 'p-limit';
|
||||
|
|
@ -61,7 +61,7 @@ const PROXY_CONFIG = {
|
|||
};
|
||||
|
||||
// Shared instances (module-scoped, not global)
|
||||
let logger: Logger;
|
||||
let logger: ReturnType<typeof getLogger>;
|
||||
let cache: CacheProvider;
|
||||
let httpClient: HttpClient;
|
||||
let concurrencyLimit: ReturnType<typeof pLimit>;
|
||||
|
|
@ -69,7 +69,7 @@ let concurrencyLimit: ReturnType<typeof pLimit>;
|
|||
// Initialize shared resources
|
||||
function initializeSharedResources() {
|
||||
if (!logger) {
|
||||
logger = new Logger('proxy-tasks');
|
||||
logger = getLogger('proxy-tasks');
|
||||
cache = createCache('hybrid');
|
||||
httpClient = new HttpClient({ timeout: 10000 }, logger);
|
||||
concurrencyLimit = pLimit(PROXY_CONFIG.CONCURRENCY_LIMIT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue