Two-stage file change detection: mtime check first, then SHA-256 hash. Implements the TwoStageChangeDetection rule.
Two-stage file change detection: mtime check first, then SHA-256 hash. Implements the TwoStageChangeDetection rule.
(detect-changes cache files)Given a RunCache and a seq of discovered file maps {:path :ns-sym}, classifies each file and returns: {:changed [file-maps...] ;; mtime AND hash differ :unchanged [file-maps...] ;; mtime same, or mtime differs but hash same :new [file-maps...] ;; not in cache :updated-entries {path -> entry}} ;; only the entries map, no other cache keys
The updated-entries map includes:
Given a RunCache and a seq of discovered file maps {:path :ns-sym},
classifies each file and returns:
{:changed [file-maps...] ;; mtime AND hash differ
:unchanged [file-maps...] ;; mtime same, or mtime differs but hash same
:new [file-maps...] ;; not in cache
:updated-entries {path -> entry}} ;; only the entries map, no other cache keys
The updated-entries map includes:
- mtime updates for files where mtime changed but hash is identical
- new entries for :changed files (with new mtime + hash)
- new entries for :new files (with mtime + hash)
- unchanged entries preserved as-is
Callers are responsible for assembling the full cache map from these entries.(file-hash path)Computes the SHA-256 hash of the file contents at the given path. Returns a lowercase hex string.
Computes the SHA-256 hash of the file contents at the given path. Returns a lowercase hex string.
(file-mtime path)Returns the last-modified time (in millis) of the file at the given path.
Returns the last-modified time (in millis) of the file at the given path.
(reconcile-deleted cache)Removes cache entries for files that no longer exist on disk. Implements DeletedFileHandling rule: silently removes entries, no warning or error emitted. Returns the updated cache.
Removes cache entries for files that no longer exist on disk. Implements DeletedFileHandling rule: silently removes entries, no warning or error emitted. Returns the updated cache.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |