chore(server): add logs to begin/end transaction

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2025-02-24 19:13:42 -05:00
parent 15a3d2ca66
commit 5fa19f9cfa
8 changed files with 29 additions and 15 deletions

View file

@ -390,7 +390,7 @@ func (p *phaseFolders) persistChanges(entry *folderEntry) (*folderEntry, error)
}
}
return nil
})
}, "scanner: persist changes")
if err != nil {
log.Error(p.ctx, "Scanner: Error persisting changes to DB", "folder", entry.path, err)
}
@ -464,7 +464,7 @@ func (p *phaseFolders) finalize(err error) error {
}
}
return nil
})
}, "scanner: finalize phaseFolders")
return errors.Join(err, errF)
}

View file

@ -159,7 +159,7 @@ func (p *phaseMissingTracks) processMissingTracks(in *missingTracks) (*missingTr
}
}
return nil
})
}, "scanner: process missing tracks")
if err != nil {
return nil, err
}

View file

@ -113,7 +113,7 @@ func (p *phaseRefreshAlbums) refreshAlbum(album *model.Album) (*model.Album, err
p.refreshed.Add(1)
p.state.changesDetected.Store(true)
return nil
})
}, "scanner: refresh album")
if err != nil {
return nil, err
}
@ -153,5 +153,5 @@ func (p *phaseRefreshAlbums) finalize(err error) error {
log.Debug(p.ctx, "Scanner: Refreshed artist annotations", "artists", cnt, "elapsed", time.Since(start))
p.state.changesDetected.Store(true)
return nil
})
}, "scanner: finalize phaseRefreshAlbums")
}

View file

@ -128,7 +128,7 @@ func (s *scannerImpl) runGC(ctx context.Context, state *scanState) func() error
log.Debug(ctx, "Scanner: No changes detected, skipping GC")
}
return nil
})
}, "scanner: GC")
}
}
@ -155,7 +155,7 @@ func (s *scannerImpl) runRefreshStats(ctx context.Context, state *scanState) fun
}
log.Debug(ctx, "Scanner: Updated tag counts", "elapsed", time.Since(start))
return nil
})
}, "scanner: refresh stats")
}
}
@ -189,7 +189,7 @@ func (s *scannerImpl) runUpdateLibraries(ctx context.Context, libs model.Librari
}
}
return nil
})
}, "scanner: update libraries")
}
}