aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/TopManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-20 00:07:06 +0300
committerGravatar Vitaly Takmazov2018-11-20 00:07:06 +0300
commit930e6ab6d604963ae6a48c58fc1bd3735071d9ee (patch)
treebb236bf36ccab695bef4d45012135c2396c84f77 /src/main/java/com/juick/server/TopManager.java
parent74740d5d989f11746266a994840f89e9f6784f73 (diff)
getMessage refactoring
Diffstat (limited to 'src/main/java/com/juick/server/TopManager.java')
-rw-r--r--src/main/java/com/juick/server/TopManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/TopManager.java b/src/main/java/com/juick/server/TopManager.java
index e5c00242..fe3d605d 100644
--- a/src/main/java/com/juick/server/TopManager.java
+++ b/src/main/java/com/juick/server/TopManager.java
@@ -42,7 +42,7 @@ public class TopManager {
@Scheduled(fixedRate = 3600000)
public void updateTop() {
messagesService.getPopularCandidates().forEach(m -> {
- Message jmsg = messagesService.getMessage(m);
+ Message jmsg = messagesService.getMessage(m).orElseThrow(IllegalStateException::new);
logger.info("added {} to popular", m);
messagesService.setMessagePopular(m, 1);
List<String> tags = jmsg.getTags().stream().map(Tag::getName).map(String::toLowerCase).collect(Collectors.toList());