small fixes
This commit is contained in:
parent
87037e013f
commit
98aa414231
6 changed files with 33 additions and 33 deletions
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
import { Hono } from 'hono';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { processItems, queueManager } from '../index';
|
||||
import { processItems, QueueManager } from '@stock-bot/queue';
|
||||
|
||||
const logger = getLogger('market-data-routes');
|
||||
|
||||
|
|
@ -16,9 +16,10 @@ marketDataRoutes.get('/api/live/:symbol', async c => {
|
|||
|
||||
try {
|
||||
// Queue job for live data using Yahoo provider
|
||||
const job = await queueManager.add('market-data-live', {
|
||||
type: 'market-data-live',
|
||||
provider: 'yahoo-finance',
|
||||
const queueManager = QueueManager.getInstance();
|
||||
const queue = queueManager.getQueue('yahoo-finance');
|
||||
const job = await queue.add('live-data', {
|
||||
handler: 'yahoo-finance',
|
||||
operation: 'live-data',
|
||||
payload: { symbol },
|
||||
});
|
||||
|
|
@ -46,9 +47,10 @@ 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.add('market-data-historical', {
|
||||
type: 'market-data-historical',
|
||||
provider: 'yahoo-finance',
|
||||
const queueManager = QueueManager.getInstance();
|
||||
const queue = queueManager.getQueue('yahoo-finance');
|
||||
const job = await queue.add('historical-data', {
|
||||
handler: 'yahoo-finance',
|
||||
operation: 'historical-data',
|
||||
payload: {
|
||||
symbol,
|
||||
|
|
@ -94,13 +96,13 @@ marketDataRoutes.post('/api/process-symbols', async c => {
|
|||
useBatching,
|
||||
});
|
||||
|
||||
const result = await processItems(symbols, queueManager, {
|
||||
const result = await processItems(symbols, provider, {
|
||||
handler: provider,
|
||||
operation,
|
||||
totalDelayHours,
|
||||
useBatching,
|
||||
batchSize,
|
||||
priority: 2,
|
||||
provider,
|
||||
operation,
|
||||
retries: 2,
|
||||
removeOnComplete: 5,
|
||||
removeOnFail: 10,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue