mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-14 06:10:29 +05:30
Set statement timeout to 20s for feed. (#309)
This commit is contained in:
parent
bcb0d32daa
commit
78b52d70f5
@ -880,7 +880,7 @@ public class ResponseHelper {
|
|||||||
|
|
||||||
List<StreamItem> feedItems = new ObjectArrayList<>();
|
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();
|
var channel = video.getChannel();
|
||||||
|
|
||||||
feedItems.add(new StreamItem("/watch?v=" + video.getId(), video.getTitle(),
|
feedItems.add(new StreamItem("/watch?v=" + video.getId(), video.getTitle(),
|
||||||
@ -930,7 +930,10 @@ public class ResponseHelper {
|
|||||||
))
|
))
|
||||||
.orderBy(cb.desc(root.get("uploaded")));
|
.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<>();
|
final List<SyndEntry> entries = new ObjectArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user