slow down ukvisajobs
This commit is contained in:
parent
45662c386a
commit
d24966e0eb
@ -57,7 +57,8 @@ export async function runUkVisaJobs(options: RunUkVisaJobsOptions = {}): Promise
|
|||||||
const allJobs: CreateJobInput[] = [];
|
const allJobs: CreateJobInput[] = [];
|
||||||
const seenIds = new Set<string>();
|
const seenIds = new Set<string>();
|
||||||
|
|
||||||
for (const term of terms) {
|
for (let i = 0; i < terms.length; i++) {
|
||||||
|
const term = terms[i];
|
||||||
const termLabel = term ? `"${term}"` : 'all jobs';
|
const termLabel = term ? `"${term}"` : 'all jobs';
|
||||||
console.log(` Running for ${termLabel}...`);
|
console.log(` Running for ${termLabel}...`);
|
||||||
|
|
||||||
@ -106,6 +107,12 @@ export async function runUkVisaJobs(options: RunUkVisaJobsOptions = {}): Promise
|
|||||||
console.error(`❌ UK Visa Jobs failed for ${termLabel}: ${message}`);
|
console.error(`❌ UK Visa Jobs failed for ${termLabel}: ${message}`);
|
||||||
// Continue to next term instead of failing completely
|
// Continue to next term instead of failing completely
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delay between terms
|
||||||
|
if (i < terms.length - 1) {
|
||||||
|
console.log(' Waiting 5s before next search term...');
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`✅ UK Visa Jobs: imported total ${allJobs.length} unique jobs`);
|
console.log(`✅ UK Visa Jobs: imported total ${allJobs.length} unique jobs`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user