failed docs p1
This commit is contained in:
parent
3c05e75b9f
commit
201bfef1a0
3 changed files with 39 additions and 20 deletions
|
|
@ -41,6 +41,7 @@ import {
|
|||
} from "./preIndexed";
|
||||
import preIndexedDocs from "./preIndexedDocs";
|
||||
import { ConfigResult } from "@continuedev/config-yaml";
|
||||
import { GlobalContext } from "../../util/GlobalContext";
|
||||
|
||||
// Purposefully lowercase because lancedb converts
|
||||
export interface LanceDbDocsRow {
|
||||
|
|
@ -908,19 +909,24 @@ export default class DocsService {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
const currentStatus = this.statuses.get(doc.startUrl);
|
||||
if (currentStatus?.status !== "failed") {
|
||||
newDocs.push(doc);
|
||||
}
|
||||
newDocs.push(doc);
|
||||
}
|
||||
}
|
||||
|
||||
const globalContext = new GlobalContext();
|
||||
const failedDocs = globalContext.get("failedDocs") ?? [];
|
||||
|
||||
const newDocsNotFailed = newDocs.filter(
|
||||
(doc) =>
|
||||
!failedDocs.find((d) => this.siteIndexingConfigsAreEqual(doc, d)),
|
||||
);
|
||||
|
||||
await Promise.allSettled([
|
||||
...changedDocs.map((doc) => this.indexAndAdd(doc, true)),
|
||||
...newDocs.map((doc) => this.indexAndAdd(doc)),
|
||||
...newDocsNotFailed.map((doc) => this.indexAndAdd(doc)),
|
||||
]);
|
||||
|
||||
for (const doc of newDocs) {
|
||||
for (const doc of newDocsNotFailed) {
|
||||
void Telemetry.capture("add_docs_config", { url: doc.startUrl });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
} from "../config/sharedConfig";
|
||||
|
||||
import { getGlobalContextFilePath } from "./paths";
|
||||
import { SiteIndexingConfig } from "..";
|
||||
|
||||
export type GlobalContextType = {
|
||||
indexingPaused: boolean;
|
||||
|
|
@ -27,6 +28,7 @@ export type GlobalContextType = {
|
|||
showConfigUpdateToast: boolean;
|
||||
isSupportedLanceDbCpuTarget: boolean;
|
||||
sharedConfig: SharedConfigSchema;
|
||||
failedDocs: SiteIndexingConfig[];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -127,25 +127,36 @@ function DocsDetailsDialog({ startUrl }: DocsDetailsDialogProps) {
|
|||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<Tooltip
|
||||
id={urlToolTipId}
|
||||
place="top"
|
||||
className="max-w-full"
|
||||
>
|
||||
{chunk.filepath}
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
id={contentToolTipId}
|
||||
place="top"
|
||||
className="max-h-[300px] max-w-[170px] overflow-y-auto"
|
||||
>
|
||||
{chunk.content}
|
||||
</Tooltip>
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
{/* Rending tooltips here because div can't be child of tbody apparently */}
|
||||
{data.chunks.map((chunk, i) => {
|
||||
const contentToolTipId = `docs-content-peek-${i}`;
|
||||
const urlToolTipId = `docs-url-peek-${i}`;
|
||||
return (
|
||||
<>
|
||||
<Tooltip
|
||||
key={urlToolTipId}
|
||||
id={urlToolTipId}
|
||||
place="top"
|
||||
className="max-w-full"
|
||||
>
|
||||
{chunk.filepath}
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
key={contentToolTipId}
|
||||
id={contentToolTipId}
|
||||
place="top"
|
||||
className="max-h-[300px] max-w-[170px] overflow-y-auto"
|
||||
>
|
||||
{chunk.content}
|
||||
</Tooltip>
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue