Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/lib/api/import/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export async function importTarget(
}

let failedMoreThanOnce = false;
let ignoreMultipleFails = false;
export async function importTargets(
requestManager: requestsManager,
targets: ImportTarget[],
Expand Down Expand Up @@ -143,13 +144,23 @@ export async function importTargets(
loggingPath,
);

if (failed % concurrentImports === 0) {
if (!ignoreMultipleFails && failed % concurrentImports === 0) {
if (failedMoreThanOnce) {
console.error(
`Every import in the last few batches failed, stopping as this is unexpected! Please check if everything is configured ok and review the logs located at ${loggingPath}/*. If everything looks OK re-start the import, previously imported targets will be skipped.`,
`Every import in the last few batches failed, stopping as this is unexpected! Please check if everything is configured ok and review the logs located at ${loggingPath}/*.`,
);
// die immediately
process.exit(1);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

rl.question("Do you want to continue anyway? (Y / N)", function(answer) {
answer = answer.toUpperCase();
if(!(answer === "Y")){
process.exit(1);
}
});
ignoreMultipleFails = true;
}
failedMoreThanOnce = true;
}
Expand Down