fix: address code review findings
This commit is contained in:
@@ -47,6 +47,7 @@ func ScanAll(ctx context.Context, db *database.DB, threshold float64) ([]Missing
|
||||
}
|
||||
|
||||
var all []MissingRelease
|
||||
var failedArtists []string
|
||||
for _, s := range settings {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return all, err
|
||||
@@ -59,10 +60,15 @@ func ScanAll(ctx context.Context, db *database.DB, threshold float64) ([]Missing
|
||||
missing, err := ScanArtist(ctx, db, s.ID, threshold)
|
||||
if err != nil {
|
||||
log.Printf("scan artist %s failed: %v", s.ID, err)
|
||||
failedArtists = append(failedArtists, s.ID)
|
||||
continue
|
||||
}
|
||||
all = append(all, missing...)
|
||||
}
|
||||
|
||||
if n := len(failedArtists); n > 0 {
|
||||
log.Printf("scan completed with %d artist(s) skipped due to errors: %v", n, failedArtists)
|
||||
}
|
||||
|
||||
return all, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user