thing im pretty much done with extracting the queue and making it reususable, maybe just a few more change to be able to making the batch names a bit more specific

This commit is contained in:
Boki 2025-06-14 18:22:28 -04:00
parent ad5e353ec3
commit e8c90532d5
14 changed files with 117 additions and 93 deletions

View file

@ -2,7 +2,7 @@
* Health check routes
*/
import { Hono } from 'hono';
import { queueManager } from '../services/queue-manager.service';
import { queueManager } from '../index';
export const healthRoutes = new Hono();

View file

@ -3,7 +3,7 @@
*/
import { Hono } from 'hono';
import { getLogger } from '@stock-bot/logger';
import { processItems, queueManager } from '../services/queue-manager.service';
import { processItems, queueManager } from '../index';
const logger = getLogger('market-data-routes');
@ -79,7 +79,7 @@ marketDataRoutes.post('/api/process-symbols', async c => {
provider = 'ib',
operation = 'fetch-session',
useBatching = true,
totalDelayMs = 30000,
totalDelayHours = 0.0083, // ~30 seconds (30/3600 hours)
batchSize = 10,
} = await c.req.json();
@ -95,7 +95,7 @@ marketDataRoutes.post('/api/process-symbols', async c => {
});
const result = await processItems(symbols, queueManager, {
totalDelayMs,
totalDelayHours,
useBatching,
batchSize,
priority: 2,

View file

@ -3,7 +3,7 @@
*/
import { Hono } from 'hono';
import { getLogger } from '@stock-bot/logger';
import { queueManager } from '../services/queue-manager.service';
import { queueManager } from '../index';
const logger = getLogger('queue-routes');