Skip to content

perf: expose FBUILD_WATCH_SET_CACHE_SECS env override for the watch-set cache window #122

Description

@zackees

Follow-up from #120.

DaemonWatchSetCache uses a hardcoded 2 s freshness window (DEFAULT_FRESHNESS in crates/fbuild-daemon/src/watch_set_cache.rs). For CI / benchmark scenarios where builds happen in rapid succession OR development sessions where the user edits slowly, the value should be tunable without a rebuild — mirroring the FBUILD_SELF_EVICTION_SECS override added in #116.

Scope:

  • Read FBUILD_WATCH_SET_CACHE_SECS at daemon startup.
  • Pass the parsed Duration to DaemonWatchSetCache::with_max_age(...) in DaemonContext::with_hub.
  • Document the env var in crates/fbuild-daemon/README.md alongside the other FBUILD_* toggles.
  • Optional: 0 means "disable the cache" — bypass the DashMap entirely so regressions are easy to A/B.

Related: #120 (the cache itself), #116 (same pattern for self-eviction).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions