Makes the scan enumeration phase visible, bounded, and cancellable. Before this, a scan whose directory walk stalled on a slow or unresponsive mount was indistinguishable from a hang.
Fixed
- The directory-walk (enumeration) phase of a scan is now visible, time-bounded, and responsive to cancel (#303). Previously a scan that was busy enumerating a large or slow path produced a single
Starting scanlog line and then nothing: no scan row existed in the database yet (it was created only after enumeration finished), so/scansand the dashboard showed nothing while the System Overview reported "no scan"; pressing Cancel did nothing because the walk never checked for cancellation; and there was no timeout, so a genuinely hung mount hung the scan until the container was restarted. Diagnosed live on a mergerfs-over-CIFS mount whose network layer was reconnecting, making eachstatblock for seconds. Four changes: (1) the scan row is created up front in a newenumeratingstate — migration 011 extends thescans.statusCHECK constraint to allowenumeratingandscanning, two values the scanner code already referenced (ScanStatusEnumerating, the reconcile query) but the constraint silently rejected, so they could never persist; the row flips toscanningonce the walk completes. (2) Enumeration emits a throttled heartbeat (Enumerating PATH: N media files found so far (M entries scanned)) every five seconds, so a slow mount is visibly making progress instead of looking dead. (3) The walk now takes a context and checks it on every entry, so a user cancel aborts it promptly and the scan is markedcancelled. (4) The walk runs underHEALARR_SCANNER_ENUMERATION_TIMEOUT(default 30m); on timeout the scan is markedabortedwith an explanatory message pointing at slow or unresponsive storage. An orphanedenumeratingrow left by a hard restart reconciles tocancelled(itscurrent_file_indexis 0, so there is nothing to resume).
Added
HEALARR_SCANNER_ENUMERATION_TIMEOUT(default30m, env only). Caps the directory-walk phase so a hung network mount can't hang a scan indefinitely. Raise it for very large libraries on slow-but-working storage.
Full Changelog: v1.3.7...v1.3.8