Первая версия
This commit is contained in:
16
src/core/IndexingClientMock.js
Normal file
16
src/core/IndexingClientMock.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user