MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / rebuild_session_index

Method rebuild_session_index

libatomic/src/daemon/services_agent.rs:4807–4831  ·  view source on GitHub ↗
(
        &self,
        request: Request<RebuildSessionIndexRequest>,
    )

Source from the content-addressed store, hash-verified

4805 }
4806
4807 async fn rebuild_session_index(
4808 &self,
4809 request: Request<RebuildSessionIndexRequest>,
4810 ) -> Result<Response<RebuildSessionIndexResponse>, Status> {
4811 // `atomic session rebuild` — the domain rebuild runs handler-side;
4812 // the counts ride the response for the local report.
4813 let request = request.into_inner();
4814 let handle = self.state.resolve(request.repository.as_ref().unwrap())?;
4815 self.state.log_rpc("RebuildSessionIndex", Some(&handle));
4816 let gate_handle = handle.clone();
4817 let _gate = gate_handle.exclusive().await;
4818 let meta = request.meta.clone();
4819 let (indexed, skipped, corrupt) = tokio::task::spawn_blocking(move || {
4820 let repo = handle.repository()?;
4821 repo.rebuild_session_index().map_err(repository_error)
4822 })
4823 .await
4824 .map_err(|e| Status::internal(e.to_string()))??;
4825 Ok(Response::new(RebuildSessionIndexResponse {
4826 indexed: indexed as u64,
4827 already_present: skipped as u64,
4828 corrupt: corrupt as u64,
4829 meta: response_meta(&meta),
4830 }))
4831 }
4832
4833 async fn get_provenance(
4834 &self,

Callers

nothing calls this directly

Calls 9

response_metaFunction · 0.85
as_refMethod · 0.80
log_rpcMethod · 0.80
exclusiveMethod · 0.80
repositoryMethod · 0.80
into_innerMethod · 0.45
resolveMethod · 0.45
unwrapMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected