Files
web_app/src/core/IndexingClientMock.js
2026-02-23 09:08:15 +03:00

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 };
}
}