Skip to content

Commit

Permalink
Fix gallery scan (#2594)
Browse files Browse the repository at this point in the history
The incorrect error check means that images is always 0, which means scanImages is also always true, which causes the images inside the zip to be unnecessarily rescanned every time.
  • Loading branch information
DingDongSoLong4 authored May 18, 2022
1 parent 1200d44 commit df24f90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/manager/task_scan_gallery.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (t *ScanTask) scanGallery(ctx context.Context) {
var err error
g, err = r.Gallery().FindByPath(path)

if g != nil && err != nil {
if g != nil && err == nil {
images, err = r.Image().CountByGalleryID(g.ID)
if err != nil {
return fmt.Errorf("error getting images for zip gallery %s: %s", path, err.Error())
Expand Down

0 comments on commit df24f90

Please sign in to comment.