aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-21 15:18:54 +0300
committerGravatar Vitaly Takmazov2018-03-21 15:18:54 +0300
commit2fda6291ef2869d4f5f29afa92737d8f0f527a0e (patch)
tree1ed1551abe8ffbda033973ab1ad4079fadc97dd5 /juick-server-jdbc/src/main/java/com/juick/service
parent2c1ea441673d9d6370e2ea419f2d0f9a863cb0d3 (diff)
xmpp: restore full tests
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java
index 77735b0c..0273c1c3 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java
@@ -187,8 +187,13 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip
@Transactional
@Override
public boolean subscribeTag(final User user, final Tag toTag) {
- return getJdbcTemplate().update(
- "INSERT IGNORE INTO subscr_tags(tag_id,suser_id) VALUES (?,?)", toTag.TID, user.getUid()) == 1;
+ try {
+
+ return getJdbcTemplate().update(
+ "INSERT INTO subscr_tags(tag_id,suser_id) VALUES (?,?)", toTag.TID, user.getUid()) == 1;
+ } catch (DuplicateKeyException e) {
+ return true;
+ }
}
@Transactional