From fa9788960e934d9b78e5968eb2c384254218090a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 15 Apr 2018 19:04:31 +0300 Subject: server: fix tags cache --- .../src/main/java/com/juick/service/TagServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'juick-server-jdbc/src/main/java/com/juick') 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 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 -- cgit v1.2.3