fix(library): a scan cut off by a restart no longer blocks saving library folders
A restart mid-scan left its scan_runs row unfinished, and saving library
folders refused ("A library scan is running") until a later scan reaped it,
up to 12 hours on. Startup now closes such rows with the reason before the
boot scan, as backups already do. Saving folders and the duplicate sweep
share one check that treats a run past StuckScanThreshold as dead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -244,7 +244,9 @@ func run() error {
|
||||
|
||||
// One unified scan chain: library walk → MBID backfill → cover enrich.
|
||||
// Boot-time scan and manual-trigger scans share this path; results land
|
||||
// in scan_runs for the admin overview.
|
||||
// in scan_runs for the admin overview. A run the last shutdown cut off is
|
||||
// closed first, so it doesn't read as a scan still going.
|
||||
library.RecoverScanRuns(ctx, pool, logger.With("component", "scan_run"))
|
||||
if cfg.Library.ScanOnStartup && len(roots) > 0 {
|
||||
go func() {
|
||||
if _, err := library.RunScan(ctx, pool, scanner, coverEnricher,
|
||||
|
||||
Reference in New Issue
Block a user