fixed error and made batch timings a little more dynamic depending on batch total instead of 15 min spread

This commit is contained in:
Bojan Kucera 2025-06-09 09:07:44 -04:00
parent b2817656b3
commit 8a588816c4
3 changed files with 47 additions and 51 deletions

View file

@ -60,7 +60,13 @@ export const proxyProvider: ProviderConfig = {
// Process a batch of proxies - uses the fetch-and-check JobNamePrefix process-(proxy)-batch
const { queueManager } = await import('../services/queue.service');
const batchProcessor = new BatchProcessor(queueManager);
return await batchProcessor.processBatch(payload);
return await batchProcessor.processBatch(
payload,
(proxy: ProxyInfo) => ({
proxy,
source: payload.config?.source || 'batch-processing'
})
);
},
'check-proxy': async (payload: {
@ -123,6 +129,7 @@ export const proxyProvider: ProviderConfig = {
type: 'proxy-maintenance',
operation: 'fetch-and-check',
payload: {},
// should remove and just run at the same time so app restarts dont keeping adding same jobs
cronPattern: getEvery24HourCron(),
priority: 5,
immediately: true,