remove redis as caching is no longer needed now

This commit is contained in:
Athou
2024-08-12 21:27:21 +02:00
parent 3af8485326
commit 044694487d
15 changed files with 22 additions and 410 deletions

View File

@@ -14,7 +14,6 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import com.commafeed.CommaFeedConfiguration;
import com.commafeed.backend.cache.CacheService;
import com.commafeed.backend.dao.FeedCategoryDAO;
import com.commafeed.backend.dao.FeedEntryStatusDAO;
import com.commafeed.backend.dao.FeedSubscriptionDAO;
@@ -89,7 +88,6 @@ public class CategoryREST {
private final FeedSubscriptionDAO feedSubscriptionDAO;
private final FeedEntryService feedEntryService;
private final FeedSubscriptionService feedSubscriptionService;
private final CacheService cache;
private final CommaFeedConfiguration config;
@Path("/entries")
@@ -291,7 +289,6 @@ public class CategoryREST {
cat.setParent(parent);
}
feedCategoryDAO.saveOrUpdate(cat);
cache.invalidateUserRootCategory(user);
return Response.ok(cat.getId()).build();
}
@@ -321,7 +318,6 @@ public class CategoryREST {
feedCategoryDAO.saveOrUpdate(categories);
feedCategoryDAO.delete(cat);
cache.invalidateUserRootCategory(user);
return Response.ok().build();
} else {
return Response.status(Status.NOT_FOUND).build();
@@ -374,7 +370,6 @@ public class CategoryREST {
}
feedCategoryDAO.saveOrUpdate(category);
cache.invalidateUserRootCategory(user);
return Response.ok().build();
}
@@ -393,7 +388,6 @@ public class CategoryREST {
}
category.setCollapsed(req.isCollapse());
feedCategoryDAO.saveOrUpdate(category);
cache.invalidateUserRootCategory(user);
return Response.ok().build();
}
@@ -418,18 +412,14 @@ public class CategoryREST {
responses = { @ApiResponse(content = @Content(schema = @Schema(implementation = Category.class))) })
public Response getRootCategory() {
User user = authenticationContext.getCurrentUser();
Category root = cache.getUserRootCategory(user);
if (root == null) {
log.debug("tree cache miss for {}", user.getId());
List<FeedCategory> categories = feedCategoryDAO.findAll(user);
List<FeedSubscription> subscriptions = feedSubscriptionDAO.findAll(user);
Map<Long, UnreadCount> unreadCount = feedSubscriptionService.getUnreadCount(user);
root = buildCategory(null, categories, subscriptions, unreadCount);
root.setId("all");
root.setName("All");
cache.setUserRootCategory(user, root);
}
List<FeedCategory> categories = feedCategoryDAO.findAll(user);
List<FeedSubscription> subscriptions = feedSubscriptionDAO.findAll(user);
Map<Long, UnreadCount> unreadCount = feedSubscriptionService.getUnreadCount(user);
Category root = buildCategory(null, categories, subscriptions, unreadCount);
root.setId("all");
root.setName("All");
return Response.ok(root).build();
}

View File

@@ -17,7 +17,6 @@ import org.jboss.resteasy.reactive.RestForm;
import com.commafeed.CommaFeedApplication;
import com.commafeed.CommaFeedConfiguration;
import com.commafeed.backend.cache.CacheService;
import com.commafeed.backend.dao.FeedCategoryDAO;
import com.commafeed.backend.dao.FeedEntryStatusDAO;
import com.commafeed.backend.dao.FeedSubscriptionDAO;
@@ -114,7 +113,6 @@ public class FeedREST {
private final FeedRefreshEngine feedRefreshEngine;
private final OPMLImporter opmlImporter;
private final OPMLExporter opmlExporter;
private final CacheService cache;
private final CommaFeedConfiguration config;
private static FeedEntry initTestEntry() {
@@ -492,7 +490,6 @@ public class FeedREST {
} else {
feedSubscriptionDAO.saveOrUpdate(subscription);
}
cache.invalidateUserRootCategory(user);
return Response.ok().build();
}