(project_path: &Path, marker_file: &str)
| 413 | |
| 414 | #[cfg(not(unix))] |
| 415 | async 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))] |
| 433 | fn safe_daemon_hook_rel_paths(paths: &[String]) -> Vec<String> { |
no test coverage detected