fixed data-service apperently
This commit is contained in:
parent
4b552e454c
commit
80c29283da
11 changed files with 106 additions and 92 deletions
|
|
@ -172,6 +172,10 @@ async function createAlphabetJobs(
|
|||
): Promise<{ success: boolean; symbolsFound: number; jobsCreated: number }> {
|
||||
try {
|
||||
const { queueManager } = await import('../index');
|
||||
if (!queueManager) {
|
||||
throw new Error('Queue manager not initialized');
|
||||
}
|
||||
const queue = queueManager.getQueue('qm');
|
||||
let jobsCreated = 0;
|
||||
|
||||
// Create jobs for A-Z
|
||||
|
|
@ -185,10 +189,10 @@ async function createAlphabetJobs(
|
|||
maxDepth,
|
||||
};
|
||||
|
||||
await queueManager.add(
|
||||
'qm',
|
||||
await queue.add(
|
||||
'spider-symbol-search',
|
||||
{
|
||||
provider: 'qm',
|
||||
handler: 'qm',
|
||||
operation: 'spider-symbol-search',
|
||||
payload: job,
|
||||
},
|
||||
|
|
@ -239,6 +243,10 @@ async function searchAndSpawnJobs(
|
|||
// If we have 50+ symbols and haven't reached max depth, spawn sub-jobs
|
||||
if (symbolCount >= 50 && depth < maxDepth) {
|
||||
const { queueManager } = await import('../index');
|
||||
if (!queueManager) {
|
||||
throw new Error('Queue manager not initialized');
|
||||
}
|
||||
const queue = queueManager.getQueue('qm');
|
||||
|
||||
logger.info(`Spawning sub-jobs for prefix "${prefix}" (${symbolCount} >= 50 symbols)`);
|
||||
|
||||
|
|
@ -254,10 +262,10 @@ async function searchAndSpawnJobs(
|
|||
maxDepth,
|
||||
};
|
||||
|
||||
await queueManager.add(
|
||||
'qm',
|
||||
await queue.add(
|
||||
'spider-symbol-search',
|
||||
{
|
||||
provider: 'qm',
|
||||
handler: 'qm',
|
||||
operation: 'spider-symbol-search',
|
||||
payload: job,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue