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

Method run_hook_incremental_sync

src/mcp/server.rs:2087–2100  ·  view source on GitHub ↗
(&self, cg: Arc<TraceDecay>, agent: HookAgent)

Source from the content-addressed store, hash-verified

2085 }
2086
2087 async fn run_hook_incremental_sync(&self, cg: Arc<TraceDecay>, agent: HookAgent) {
2088 let marker = hook_events::sync_marker_path(&cg.store_layout().data_root, agent);
2089 let now = crate::tracedecay::current_timestamp();
2090 if !hook_events::should_run_sync(&marker, now, 3) {
2091 return;
2092 }
2093 match cg.sync().await {
2094 Ok(_) | Err(TraceDecayError::SyncLock { .. }) => {
2095 hook_events::write_sync_marker(&marker, now);
2096 self.refresh_file_token_map().await;
2097 }
2098 Err(e) => eprintln!("[tracedecay] hook incremental sync failed: {e}"),
2099 }
2100 }
2101
2102 /// Handles the `initialize` method, returning server capabilities.
2103 fn handle_initialize(id: Value) -> JsonRpcResponse {

Callers 1

run_hook_event_planMethod · 0.80

Calls 7

sync_marker_pathFunction · 0.85
current_timestampFunction · 0.85
should_run_syncFunction · 0.85
write_sync_markerFunction · 0.85
store_layoutMethod · 0.80
syncMethod · 0.80

Tested by

no test coverage detected