fully cleaned things up, few more things to go.

This commit is contained in:
Boki 2025-06-14 15:42:47 -04:00
parent e5170b1c78
commit ad5e353ec3
11 changed files with 180 additions and 362 deletions

View file

@ -3,7 +3,7 @@
*/
import { Hono } from 'hono';
import { getLogger } from '@stock-bot/logger';
import { queueManager } from '../services/queue-manager.service';
import { processItems, queueManager } from '../services/queue-manager.service';
const logger = getLogger('market-data-routes');
@ -16,7 +16,7 @@ marketDataRoutes.get('/api/live/:symbol', async c => {
try {
// Queue job for live data using Yahoo provider
const job = await queueManager.addJob('market-data-live', {
const job = await queueManager.add('market-data-live', {
type: 'market-data-live',
provider: 'yahoo-finance',
operation: 'live-data',
@ -46,7 +46,7 @@ marketDataRoutes.get('/api/historical/:symbol', async c => {
const toDate = to ? new Date(to) : new Date(); // Now
// Queue job for historical data using Yahoo provider
const job = await queueManager.addJob('market-data-historical', {
const job = await queueManager.add('market-data-historical', {
type: 'market-data-historical',
provider: 'yahoo-finance',
operation: 'historical-data',
@ -94,7 +94,7 @@ marketDataRoutes.post('/api/process-symbols', async c => {
useBatching,
});
const result = await queueManager.processSymbols(symbols, {
const result = await processItems(symbols, queueManager, {
totalDelayMs,
useBatching,
batchSize,