trying to get simpler batcher working

This commit is contained in:
Boki 2025-06-10 22:00:58 -04:00
parent 746a0fd949
commit 682b50d3b2
5 changed files with 82 additions and 652 deletions

View file

@ -25,22 +25,24 @@ export const proxyProvider: ProviderConfig = {
if (proxies.length === 0) {
return { proxiesFetched: 0, jobsCreated: 0 };
}
// Use simplified functional approach
} // Use simplified functional approach
const result = await processProxies(proxies, queueManager, {
totalDelayMs: parseInt(process.env.PROXY_VALIDATION_HOURS || '4') * 60 * 60 * 1000,
batchSize: parseInt(process.env.PROXY_BATCH_SIZE || '200'),
useBatching: process.env.PROXY_DIRECT_MODE !== 'true',
priority: 2
}); return {
priority: 2,
service: 'proxy',
provider: 'proxy-service',
operation: 'check-proxy'
});return {
proxiesFetched: result.totalItems,
jobsCreated: result.jobsCreated,
mode: result.mode,
batchesCreated: result.batchesCreated,
processingTimeMs: result.duration
};
}, 'process-proxy-batch': async (payload: any) => {
},
'process-batch-items': async (payload: any) => {
// Process a batch using the simplified batch helpers
const { processBatchJob } = await import('../utils/batch-helpers');
const { queueManager } = await import('../services/queue.service');