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

Function cursor_should_run_sync

src/hooks/cursor.rs:563–568  ·  view source on GitHub ↗

Returns `true` when a sync should run given the last marker time and a debounce window. Used to coalesce back-to-back `afterShellExecution` syncs.

(now_secs: i64, last_secs: Option<i64>, debounce_secs: i64)

Source from the content-addressed store, hash-verified

561/// Returns `true` when a sync should run given the last marker time and a
562/// debounce window. Used to coalesce back-to-back `afterShellExecution` syncs.
563pub fn cursor_should_run_sync(now_secs: i64, last_secs: Option<i64>, debounce_secs: i64) -> bool {
564 match last_secs {
565 Some(last) => now_secs - last >= debounce_secs,
566 None => true,
567 }
568}
569
570/// Builds the Cursor `sessionStart` output JSON (`additional_context` + `env`).
571/// When `project_root` is known, exposes it as `TRACEDECAY_PROJECT_ROOT` so

Callers 2

should_run_syncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected