Skip to content

Commit

Permalink
Increase timeout & update Spring Boot
Browse files Browse the repository at this point in the history
  • Loading branch information
mithandir committed Aug 23, 2024
1 parent 8081447 commit 6845487
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<version>3.3.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>ch.climbd</groupId>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/ch/climbd/newsfeed/controller/MongoController.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public List<NewsEntry> findAllOrderedByDate(Set<String> language) {
query.addCriteria(Criteria.where("language").in(language));
query.with(Sort.by(Sort.Direction.DESC, "publishedAt"));
query.limit(100);
query.maxTimeMsec(1000);
query.maxTimeMsec(5000);

return template.find(query, NewsEntry.class);
}
Expand All @@ -70,7 +70,7 @@ public List<NewsEntry> findAllOrderedByVotes(Set<String> language) {
query.addCriteria(Criteria.where("votes").gte(1));
query.with(Sort.by(Sort.Direction.DESC, "publishedAt"));
query.limit(100);
query.maxTimeMsec(1000);
query.maxTimeMsec(5000);

var result = template.find(query, NewsEntry.class);
result.sort(compareByVotePerDay);
Expand All @@ -96,7 +96,7 @@ public List<NewsEntry> findAllOrderedByViews(Set<String> language) {
query.addCriteria(Criteria.where("views").gte(1));
query.with(Sort.by(Sort.Direction.DESC, "views"));
query.limit(100);
query.maxTimeMsec(1000);
query.maxTimeMsec(5000);

var result = template.find(query, NewsEntry.class);
result.sort(compareByViewPerDay);
Expand All @@ -108,7 +108,7 @@ public List<NewsEntry> findAllFilterdBySite(String host) {
query.addCriteria(Criteria.where("link").regex("^" + host));
query.with(Sort.by(Sort.Direction.DESC, "publishedAt"));
query.limit(100);
query.maxTimeMsec(1000);
query.maxTimeMsec(5000);

return template.find(query, NewsEntry.class);
}
Expand All @@ -118,7 +118,7 @@ public List<NewsEntry> findLast100PostsPostedInTheLast48h() {
query.addCriteria(Criteria.where("publishedAt").gte(ZonedDateTime.now().minusDays(2).toInstant()));
query.with(Sort.by(Sort.Direction.DESC, "publishedAt"));
query.limit(100);
query.maxTimeMsec(1000);
query.maxTimeMsec(5000);

return template.find(query, NewsEntry.class);
}
Expand Down

0 comments on commit 6845487

Please sign in to comment.