aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-08-09 11:47:17 +0300
committerGravatar Vitaly Takmazov2019-08-09 11:47:17 +0300
commiteb3a8ffb7500ca399e3d54faf185d21f4dbd0b1b (patch)
tree05f0975151488edf91117eab96f9d393b31a5aa1 /src/main/java/com/juick
parent4f1b9963598fcd9d24a05c21560934b78709f031 (diff)
Revert "More caches"
This reverts commit 82cbd49555a723f91ed3684a64debeade9c0b3f8.
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/server/configuration/WwwAppConfiguration.java2
-rw-r--r--src/main/java/com/juick/service/MessagesService.java8
2 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java b/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java
index 45950eb0..0c5c8dbf 100644
--- a/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java
+++ b/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java
@@ -63,7 +63,7 @@ public class WwwAppConfiguration implements WebMvcConfigurer {
private String imgDir;
@Bean
public CacheManager cacheManager() {
- return new CaffeineCacheManager("help", "users_by_name", "discussions", "messages", "replies");
+ return new CaffeineCacheManager("help", "users_by_name", "discussions");
}
@Bean
diff --git a/src/main/java/com/juick/service/MessagesService.java b/src/main/java/com/juick/service/MessagesService.java
index 2b75a53a..490e0cfc 100644
--- a/src/main/java/com/juick/service/MessagesService.java
+++ b/src/main/java/com/juick/service/MessagesService.java
@@ -32,10 +32,10 @@ import java.util.*;
* Created by aalexeev on 11/13/16.
*/
public interface MessagesService {
- @CacheEvict(value = { "discussions", "messages", "replies" }, allEntries = true)
+ @CacheEvict(value = "discussions", allEntries = true)
int createMessage(int uid, String txt, String attachment, List<com.juick.Tag> tags);
- @CacheEvict(value = { "discussions", "messages", "replies" }, allEntries = true)
+ @CacheEvict(value = "discussions", allEntries = true)
int createReply(int mid, int rid, User user, String txt, String attachment);
int getReplyIDIncrement(int mid);
@@ -87,7 +87,7 @@ public interface MessagesService {
List<Integer> getPrivate(int uid, int before);
- @Cacheable(value = "discussions", key="#uid + #to")
+ @Cacheable(value = "discussions", key="#uid")
List<Integer> getDiscussions(int uid, Long to);
List<Integer> getRecommended(int uid, int before);
@@ -112,12 +112,10 @@ public interface MessagesService {
List<Integer> getUserSearch(User visitor, int UID, String search, int privacy, int page);
- @Cacheable(value = "messages", key="#visitor.uid + #mids.hashCode()")
List<com.juick.Message> getMessages(User visitor, List<Integer> mids);
Map<Integer,Set<Reaction>> updateReactionsFor(final List<Integer> mid);
- @Cacheable(value = "replies", key="#user.uid + #mid")
List<com.juick.Message> getReplies(User user, int mid);
boolean setMessagePopular(int mid, int popular);