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

Function run_debounced_hook_sync_without_daemon

src/daemon.rs:415–430  ·  view source on GitHub ↗
(project_path: &Path, marker_file: &str)

Source from the content-addressed store, hash-verified

413
414#[cfg(not(unix))]
415async fn run_debounced_hook_sync_without_daemon(project_path: &Path, marker_file: &str) {
416 let Ok(cg) = crate::tracedecay::TraceDecay::open(project_path).await else {
417 return;
418 };
419 let marker = cg.store_layout().data_root.join(marker_file);
420 let now = crate::tracedecay::current_timestamp();
421 if !crate::hooks::cursor_should_run_sync(now, read_hook_marker_secs(&marker), 3) {
422 return;
423 }
424 match cg.sync().await {
425 Ok(_) | Err(TraceDecayError::SyncLock { .. }) => {
426 let _ = std::fs::write(marker, now.to_string());
427 }
428 Err(_) => {}
429 }
430}
431
432#[cfg(not(unix))]
433fn safe_daemon_hook_rel_paths(paths: &[String]) -> Vec<String> {

Callers 2

notify_hook_eventFunction · 0.85

Calls 6

current_timestampFunction · 0.85
cursor_should_run_syncFunction · 0.85
read_hook_marker_secsFunction · 0.85
writeFunction · 0.85
store_layoutMethod · 0.80
syncMethod · 0.80

Tested by

no test coverage detected