trieve-fern-adapter
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -179,3 +179,5 @@ #!/usr/bin/env node | ||
const [namespace, ...parts] = (_a = summary === null || summary === void 0 ? void 0 : summary.toLowerCase().split(' ')) !== null && _a !== void 0 ? _a : []; | ||
const endpoint = namespace ? join(pluralize(parts.join('-')), namespace) : path; | ||
const endpoint = namespace | ||
? join(pluralize(parts.join('-')), namespace) | ||
: path; | ||
const pageLink = `${siteUrl}/${apiRefParent}/${endpoint}`; | ||
@@ -326,9 +328,17 @@ const metadata = { | ||
console.log(`Creating chunk batch ${i + 1} - ${i + 120}`); | ||
let retries = 0; | ||
while (true) { | ||
try { | ||
await trieve.createChunk(chunkBatch); | ||
console.log('Batch created'); | ||
break; | ||
} | ||
catch (err) { | ||
console.error('Error creating chunk batch, retrying...', err); | ||
console.error('Error creating chunk batch...', err); | ||
retries++; | ||
if (retries > 3) { | ||
console.error('Max retries exceeded, skipping batch'); | ||
break; | ||
} | ||
console.log('Retrying...'); | ||
} | ||
@@ -335,0 +345,0 @@ } |
{ | ||
"name": "trieve-fern-adapter", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
17014
346