fixed libs ready for new data-injection
This commit is contained in:
parent
c5a114d544
commit
8405f44bd9
25 changed files with 277 additions and 241 deletions
|
|
@ -3,8 +3,8 @@ export { Queue, type QueueWorkerConfig } from './queue';
|
|||
export { QueueManager } from './queue-manager';
|
||||
export { createJobHandler } from './types';
|
||||
|
||||
// Re-export handler registry from new location
|
||||
export { handlerRegistry } from '@stock-bot/handlers';
|
||||
// Re-export handler registry from types package
|
||||
export { handlerRegistry } from '@stock-bot/types';
|
||||
|
||||
// Batch processing
|
||||
export { processBatchJob, processItems } from './batch-processor';
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ export class QueueManager {
|
|||
*/
|
||||
startAllWorkers(): void {
|
||||
if (!this.config.delayWorkerStart) {
|
||||
logger.warn('startAllWorkers() called but delayWorkerStart is not enabled');
|
||||
logger.info('startAllWorkers() called but workers already started automatically (delayWorkerStart is false)');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Queue as BullQueue, QueueEvents, Worker, type Job } from 'bullmq';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { handlerRegistry } from '@stock-bot/handlers';
|
||||
import { handlerRegistry } from '@stock-bot/types';
|
||||
import type { JobData, JobOptions, QueueStats, RedisConfig } from './types';
|
||||
import { getRedisConnection } from './utils';
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ export class Queue {
|
|||
|
||||
try {
|
||||
// Look up handler in registry
|
||||
const jobHandler = handlerRegistry.getHandler(handler, operation);
|
||||
const jobHandler = handlerRegistry.getOperation(handler, operation);
|
||||
|
||||
if (!jobHandler) {
|
||||
throw new Error(`No handler found for ${handler}:${operation}`);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// Re-export handler types from new location
|
||||
// Re-export handler types from shared types package
|
||||
export type {
|
||||
JobHandler,
|
||||
TypedJobHandler,
|
||||
HandlerConfig,
|
||||
HandlerConfigWithSchedule,
|
||||
ScheduledJob,
|
||||
} from '@stock-bot/handlers';
|
||||
} from '@stock-bot/types';
|
||||
|
||||
// Types for queue operations
|
||||
export interface JobData<T = unknown> {
|
||||
|
|
@ -110,8 +110,8 @@ export interface QueueConfig extends QueueManagerConfig {
|
|||
enableMetrics?: boolean;
|
||||
}
|
||||
|
||||
// Re-export createJobHandler from handlers library
|
||||
export { createJobHandler } from '@stock-bot/handlers';
|
||||
// Re-export createJobHandler from shared types package
|
||||
export { createJobHandler } from '@stock-bot/types';
|
||||
|
||||
export interface BatchJobData {
|
||||
payloadKey: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue