mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Add more logs to GC call
This commit is contained in:
parent
eb109ebeb4
commit
5f40801a78
1 changed files with 10 additions and 1 deletions
|
@ -110,25 +110,34 @@ func (s *SQLStore) WithTx(block func(tx model.DataStore) error) error {
|
||||||
func (s *SQLStore) GC(ctx context.Context) error {
|
func (s *SQLStore) GC(ctx context.Context) error {
|
||||||
err := s.Album(ctx).(*albumRepository).purgeEmpty()
|
err := s.Album(ctx).(*albumRepository).purgeEmpty()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error(ctx, "Error removing empty albums", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = s.Artist(ctx).(*artistRepository).purgeEmpty()
|
err = s.Artist(ctx).(*artistRepository).purgeEmpty()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error(ctx, "Error removing empty artists", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = s.MediaFile(ctx).(*mediaFileRepository).cleanAnnotations()
|
err = s.MediaFile(ctx).(*mediaFileRepository).cleanAnnotations()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error(ctx, "Error removing orphan mediafile annotations", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = s.Album(ctx).(*albumRepository).cleanAnnotations()
|
err = s.Album(ctx).(*albumRepository).cleanAnnotations()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error(ctx, "Error removing orphan album annotations", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = s.Artist(ctx).(*artistRepository).cleanAnnotations()
|
err = s.Artist(ctx).(*artistRepository).cleanAnnotations()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error(ctx, "Error removing orphan artist annotations", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return s.Playlist(ctx).(*playlistRepository).removeOrphans()
|
err = s.Playlist(ctx).(*playlistRepository).removeOrphans()
|
||||||
|
if err != nil {
|
||||||
|
log.Error(ctx, "Error tidying up playlists", err)
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SQLStore) getOrmer() orm.Ormer {
|
func (s *SQLStore) getOrmer() orm.Ormer {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue