Set statement timeout to 20s for feed. (#309)

This commit is contained in:
Kavin 2022-07-07 20:05:34 +01:00 committed by GitHub
parent bcb0d32daa
commit 78b52d70f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -880,7 +880,7 @@ public class ResponseHelper {
List<StreamItem> feedItems = new ObjectArrayList<>();
for (Video video : s.createQuery(criteria).list()) {
for (Video video : s.createQuery(criteria).setTimeout(20).list()) {
var channel = video.getChannel();
feedItems.add(new StreamItem("/watch?v=" + video.getId(), video.getTitle(),
@ -930,7 +930,10 @@ public class ResponseHelper {
))
.orderBy(cb.desc(root.get("uploaded")));
List<Video> videos = s.createQuery(criteria).setMaxResults(100).list();
List<Video> videos = s.createQuery(criteria)
.setTimeout(20)
.setMaxResults(100)
.list();
final List<SyndEntry> entries = new ObjectArrayList<>();