You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5ee103d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/usage.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,8 @@ curl -X PUT "localhost:8080/v1/repos/<id>/bundle?ref=$(git rev-parse HEAD)&full=
43
43
44
44
`ref` is the full 40 character lowercase sha of the bundle's `HEAD`. With `full=true` the bundle holds the whole history and the tree is re-indexed, deleting documents of files that are gone. With `full=false` the bundle may be incremental (`git bundle create out.bundle <last-sha>..HEAD`) and only changed files are indexed. If the server no longer has the last indexed commit, or the bundle needs commits it lacks, the answer is 409 (`need_full_bundle`) and the client sends a full bundle. The answer is a report with `indexed_commit`, `files_indexed`, `files_unchanged`, `files_skipped`, `files_deleted` and `chunks`.
45
45
46
+
`DELETE /v1/repos/{id}` needs an `ingest` key and deletes one of the tenant's repos with everything the admin delete of a source removes: the source, its documents and chunks, its mirror and its checkout on the server. The answer is 204. An unknown id, an id of another tenant and an id that is not a repo are all a 404. While a run of the repo is going (a push, a sync, or a `lore index` Job whose run was written in the last 90 seconds) the answer is 409, and nothing is deleted; try again when the run ends. `curl -X DELETE localhost:8080/v1/repos/<id> -H "Authorization: Bearer $LORE_KEY"`.
47
+
46
48
`GET /v1/repos/{id}/progress` needs a `read` key and answers with the latest index run of that repo, whichever process ran it (while a run is queued behind another, the queued run is the latest, so the one indexing is not shown until the queued one starts): `{"id", "stage", "commit", "full", "files_done", "files_total", "chunks", "chunks_embedded", "embed_ms", "started_at", "updated_at", "finished_at", "error", "stale"}`. `stage` is `queued` (waiting for another run on the same repo), `cloning` (fetching the commit), `indexing`, `done` or `failed`, and `error` says why a run failed. `files_total` is null until the files to index are known. A run that has not ended and has not been updated for 90 seconds is shown with `"stale": true`: its process most likely died. The stage is left as it was, and the run stays that way until the next run starts. A repo that has no run yet answers 404 `no_index_run`; a repo of another tenant answers the usual 404.
47
49
48
50
Progress is kept in the Postgres table `index_runs`, one row per run (source, tenant, stage, files done and total, chunks, start and finish times, error), so it survives a restart and a process other than the server can report through it. An indexer writes its counts at most once a second, writes a change of stage or the end of a run at once, and refreshes `updated_at` every 5 seconds while it is alive. If a write fails, the failure is logged and the index carries on. The rows go with their source or tenant when it is deleted.
0 commit comments