MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / remove_enrollment_marker

Function remove_enrollment_marker

src/storage.rs:158–179  ·  view source on GitHub ↗
(project_root: &Path, project_id: &str)

Source from the content-addressed store, hash-verified

156}
157
158pub fn remove_enrollment_marker(project_root: &Path, project_id: &str) -> Result<bool> {
159 let path = enrollment_marker_path(project_root);
160 let Some(marker) = read_enrollment_marker(project_root)? else {
161 return Ok(false);
162 };
163 if marker.project_id != project_id || marker.storage_mode != StorageMode::ProfileSharded {
164 return Err(TraceDecayError::Config {
165 message: format!(
166 "refusing to remove enrollment marker '{}': it does not match project_id '{}'",
167 path.display(),
168 project_id
169 ),
170 });
171 }
172 fs::remove_file(&path).map_err(|e| TraceDecayError::Config {
173 message: format!(
174 "failed to remove enrollment marker '{}': {e}",
175 path.display()
176 ),
177 })?;
178 Ok(true)
179}
180
181pub fn profile_sharded_data_root(profile_root: &Path, project_id: &str) -> PathBuf {
182 profile_root.join("projects").join(project_id)

Callers 1

handle_migrate_actionFunction · 0.85

Calls 2

enrollment_marker_pathFunction · 0.85
read_enrollment_markerFunction · 0.85

Tested by

no test coverage detected