fix(api): wrap recalc match score in transaction to allow lazy load (#2332)

This commit is contained in:
James Ward
2026-08-11 16:19:42 -04:00
committed by GitHub
parent 42378ec8c9
commit dbd91065f6
@@ -8,6 +8,7 @@ import org.booklore.service.appsettings.AppSettingService;
import org.booklore.service.book.BookQueryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -18,6 +19,7 @@ public class MetadataMatchService {
private final AppSettingService appSettingsService;
private final BookQueryService bookQueryService;
@Transactional
public void recalculateAllMatchScores() {
List<BookEntity> allBooks = bookQueryService.getAllFullBookEntities();
for (BookEntity book : allBooks) {