From 78b52d70f5984140cf303e708d5e55ac58b3785b Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 7 Jul 2022 20:05:34 +0100 Subject: [PATCH] Set statement timeout to 20s for feed. (#309) --- src/main/java/me/kavin/piped/utils/ResponseHelper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 23827d0..bfc190e 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -880,7 +880,7 @@ public class ResponseHelper { List 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