diff --git a/orchestrator/src/server/services/ukvisajobs.ts b/orchestrator/src/server/services/ukvisajobs.ts index ecc306e..0b3fc7c 100644 --- a/orchestrator/src/server/services/ukvisajobs.ts +++ b/orchestrator/src/server/services/ukvisajobs.ts @@ -57,7 +57,8 @@ export async function runUkVisaJobs(options: RunUkVisaJobsOptions = {}): Promise const allJobs: CreateJobInput[] = []; const seenIds = new Set(); - for (const term of terms) { + for (let i = 0; i < terms.length; i++) { + const term = terms[i]; const termLabel = term ? `"${term}"` : 'all jobs'; 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}`); // 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`);