17 lines
545 B
JavaScript
17 lines
545 B
JavaScript
export class IndexingClientMock {
|
|
async submitSnapshot(projectId, files) {
|
|
return this.#simulateJob("snapshot", projectId, files.length);
|
|
}
|
|
|
|
async submitChanges(projectId, changedFiles) {
|
|
return this.#simulateJob("changes", projectId, changedFiles.length);
|
|
}
|
|
|
|
async #simulateJob(type, projectId, count) {
|
|
void projectId;
|
|
const jobId = `${type}-${Date.now()}`;
|
|
await new Promise((resolve) => setTimeout(resolve, 550));
|
|
return { index_job_id: jobId, status: "done", indexed_files: count, failed_files: 0 };
|
|
}
|
|
}
|