Makes log a bit more beautiful
This commit is contained in:
8
main.go
8
main.go
@@ -183,7 +183,7 @@ func (a *appData) indexAlbum(stopChan <-chan struct{},
|
|||||||
}
|
}
|
||||||
err := batch.Index(AlbumIDString(album.ID), a)
|
err := batch.Index(AlbumIDString(album.ID), a)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.errors <- fmt.Errorf("[INDEX] could not batch indexion of %d: %s", album.ID, err)
|
a.errors <- fmt.Errorf("[INDEX] could not batch indexion of %s: %s", album, err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
@@ -198,7 +198,7 @@ func (a *appData) indexAlbum(stopChan <-chan struct{},
|
|||||||
}
|
}
|
||||||
err := a.index.Index(AlbumIDString(album.ID), a)
|
err := a.index.Index(AlbumIDString(album.ID), a)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.errors <- fmt.Errorf("[INDEX] re-indexing %d failed: %s", album.ID, err)
|
a.errors <- fmt.Errorf("[INDEX] re-indexing %s failed: %s", album, err)
|
||||||
}
|
}
|
||||||
case aID, ok := <-albumToDelete:
|
case aID, ok := <-albumToDelete:
|
||||||
if ok == false {
|
if ok == false {
|
||||||
@@ -227,12 +227,12 @@ func (a *appData) cacheAlbumDescription(getAlbum <-chan *Album, toIndex chan<- *
|
|||||||
|
|
||||||
err = a.getter.Get(album)
|
err = a.getter.Get(album)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.errors <- fmt.Errorf("[CACHE ALBUMS]: getting %d :%s", album.ID, err)
|
a.errors <- fmt.Errorf("[CACHE ALBUMS]: getting %s :%s", album, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = a.db.AddOrUpdate(album)
|
err = a.db.AddOrUpdate(album)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.errors <- fmt.Errorf("[CACHE ALBUMS]: storing %d: %s", album.ID, err)
|
a.errors <- fmt.Errorf("[CACHE ALBUMS]: storing %s: %s", album, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
toIndex <- album
|
toIndex <- album
|
||||||
|
|||||||
Reference in New Issue
Block a user