ScanAll should only log an error when an error occurs (#20087)

Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
Todd Whiteman 2024-03-27 00:15:14 -07:00 committed by GitHub
parent aa4a142bc1
commit 06f53368cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -379,7 +379,9 @@ func (bc *basicController) ScanAll(ctx context.Context, trigger string, async bo
}
err = bc.startScanAll(ctx, executionID)
log.Errorf("failed to start scan all, executionID=%d, error: %v", executionID, err)
if err != nil {
log.Errorf("failed to start scan all, executionID=%d, error: %v", executionID, err)
}
}(bc.makeCtx())
} else {
if err := bc.startScanAll(ctx, executionID); err != nil {