aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-15 19:04:31 +0300
committerGravatar Vitaly Takmazov2018-04-15 19:04:31 +0300
commitfa9788960e934d9b78e5968eb2c384254218090a (patch)
tree7b1d25bd086f40277a220a86d92e38ee51e77257 /juick-server-jdbc/src/main/java
parent047a9da1610a69077ae3a4598accf8b838206d92 (diff)
server: fix tags cache
Diffstat (limited to 'juick-server-jdbc/src/main/java')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
index 90b70612..403dac09 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
@@ -214,8 +214,11 @@ public class TagServiceImpl extends BaseJdbcService implements TagService {
newTags.stream().filter(t -> !currentTags.contains(t))
.forEach(t -> getJdbcTemplate().update("INSERT INTO messages_tags(message_id,tag_id) VALUES (?,?)", mid, t.TID));
- return getMessageTags(mid).stream()
+ List<Tag> result = getMessageTags(mid).stream()
.map(TagStats::getTag).collect(Collectors.toList());
+ jdbcTemplate.update("UPDATE messages_txt SET tags=? WHERE message_id=?", result.stream()
+ .map(Tag::getName).collect(Collectors.joining(" ")), mid);
+ return result;
}
@Override