mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
cache unread count
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.commafeed.backend.cache;
|
package com.commafeed.backend.cache;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ public abstract class CacheService {
|
|||||||
|
|
||||||
public abstract void setRootCategory(User user, Category category);
|
public abstract void setRootCategory(User user, Category category);
|
||||||
|
|
||||||
public abstract void invalidateRootCategory(User... users);
|
public abstract Map<Long, Long> getUnreadCounts(User user);
|
||||||
|
|
||||||
|
public abstract void setUnreadCounts(User user, Map<Long, Long> map);
|
||||||
|
|
||||||
|
public abstract void invalidateUserData(User... users);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.commafeed.backend.cache;
|
|||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import javax.enterprise.context.ApplicationScoped;
|
||||||
import javax.enterprise.inject.Alternative;
|
import javax.enterprise.inject.Alternative;
|
||||||
@@ -34,7 +35,18 @@ public class NoopCacheService extends CacheService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidateRootCategory(User... users) {
|
public Map<Long, Long> getUnreadCounts(User user) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUnreadCounts(User user, Map<Long, Long> map) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invalidateUserData(User... users) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.commafeed.backend.cache;
|
package com.commafeed.backend.cache;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -21,13 +22,15 @@ import com.commafeed.backend.model.User;
|
|||||||
import com.commafeed.frontend.model.Category;
|
import com.commafeed.frontend.model.Category;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.type.MapType;
|
||||||
import com.google.api.client.util.Lists;
|
import com.google.api.client.util.Lists;
|
||||||
|
|
||||||
@Alternative
|
@Alternative
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class RedisCacheService extends CacheService {
|
public class RedisCacheService extends CacheService {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(RedisCacheService.class);
|
private static final Logger log = LoggerFactory
|
||||||
|
.getLogger(RedisCacheService.class);
|
||||||
|
|
||||||
private JedisPool pool = new JedisPool(new JedisPoolConfig(), "localhost");
|
private JedisPool pool = new JedisPool(new JedisPoolConfig(), "localhost");
|
||||||
private ObjectMapper mapper = new ObjectMapper();
|
private ObjectMapper mapper = new ObjectMapper();
|
||||||
@@ -103,7 +106,45 @@ public class RedisCacheService extends CacheService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidateRootCategory(User... users) {
|
public Map<Long, Long> getUnreadCounts(User user) {
|
||||||
|
Map<Long, Long> map = null;
|
||||||
|
Jedis jedis = pool.getResource();
|
||||||
|
try {
|
||||||
|
String key = buildRedisUnreadCountKey(user);
|
||||||
|
String json = jedis.get(key);
|
||||||
|
if (json != null) {
|
||||||
|
MapType type = mapper.getTypeFactory().constructMapType(
|
||||||
|
Map.class, Long.class, Long.class);
|
||||||
|
map = mapper.readValue(json, type);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
} finally {
|
||||||
|
pool.returnResource(jedis);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUnreadCounts(User user, Map<Long, Long> map) {
|
||||||
|
Jedis jedis = pool.getResource();
|
||||||
|
try {
|
||||||
|
String key = buildRedisUnreadCountKey(user);
|
||||||
|
|
||||||
|
Pipeline pipe = jedis.pipelined();
|
||||||
|
pipe.del(key);
|
||||||
|
pipe.set(key, mapper.writeValueAsString(map));
|
||||||
|
pipe.expire(key, (int) TimeUnit.MINUTES.toSeconds(30));
|
||||||
|
pipe.sync();
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
} finally {
|
||||||
|
pool.returnResource(jedis);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invalidateUserData(User... users) {
|
||||||
Jedis jedis = pool.getResource();
|
Jedis jedis = pool.getResource();
|
||||||
try {
|
try {
|
||||||
Pipeline pipe = jedis.pipelined();
|
Pipeline pipe = jedis.pipelined();
|
||||||
@@ -111,6 +152,8 @@ public class RedisCacheService extends CacheService {
|
|||||||
for (User user : users) {
|
for (User user : users) {
|
||||||
String key = buildRedisRootCategoryKey(user);
|
String key = buildRedisRootCategoryKey(user);
|
||||||
pipe.del(key);
|
pipe.del(key);
|
||||||
|
key = buildRedisUnreadCountKey(user);
|
||||||
|
pipe.del(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pipe.sync();
|
pipe.sync();
|
||||||
@@ -123,6 +166,10 @@ public class RedisCacheService extends CacheService {
|
|||||||
return "root_cat:" + Models.getId(user);
|
return "root_cat:" + Models.getId(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String buildRedisUnreadCountKey(User user) {
|
||||||
|
return "unread_count:" + Models.getId(user);
|
||||||
|
}
|
||||||
|
|
||||||
private String buildRedisEntryKey(Feed feed) {
|
private String buildRedisEntryKey(Feed feed) {
|
||||||
return "feed:" + feed.getId();
|
return "feed:" + feed.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,6 @@ public class OPMLImporter {
|
|||||||
log.error("error while importing {}: {}", outline.getXmlUrl(), e.getMessage());
|
log.error("error while importing {}: {}", outline.getXmlUrl(), e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(user);
|
cache.invalidateUserData(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.commafeed.backend.services;
|
package com.commafeed.backend.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ejb.ApplicationException;
|
import javax.ejb.ApplicationException;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -9,6 +10,7 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.commafeed.backend.cache.CacheService;
|
||||||
import com.commafeed.backend.dao.FeedEntryDAO;
|
import com.commafeed.backend.dao.FeedEntryDAO;
|
||||||
import com.commafeed.backend.dao.FeedEntryStatusDAO;
|
import com.commafeed.backend.dao.FeedEntryStatusDAO;
|
||||||
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
||||||
@@ -19,12 +21,14 @@ import com.commafeed.backend.model.FeedCategory;
|
|||||||
import com.commafeed.backend.model.FeedEntry;
|
import com.commafeed.backend.model.FeedEntry;
|
||||||
import com.commafeed.backend.model.FeedEntryStatus;
|
import com.commafeed.backend.model.FeedEntryStatus;
|
||||||
import com.commafeed.backend.model.FeedSubscription;
|
import com.commafeed.backend.model.FeedSubscription;
|
||||||
|
import com.commafeed.backend.model.Models;
|
||||||
import com.commafeed.backend.model.User;
|
import com.commafeed.backend.model.User;
|
||||||
import com.google.api.client.util.Lists;
|
import com.google.api.client.util.Lists;
|
||||||
|
|
||||||
public class FeedSubscriptionService {
|
public class FeedSubscriptionService {
|
||||||
|
|
||||||
private static Logger log = LoggerFactory.getLogger(FeedSubscriptionService.class);
|
private static Logger log = LoggerFactory
|
||||||
|
.getLogger(FeedSubscriptionService.class);
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
@ApplicationException
|
@ApplicationException
|
||||||
@@ -52,6 +56,9 @@ public class FeedSubscriptionService {
|
|||||||
@Inject
|
@Inject
|
||||||
FeedRefreshTaskGiver taskGiver;
|
FeedRefreshTaskGiver taskGiver;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
CacheService cache;
|
||||||
|
|
||||||
public Feed subscribe(User user, String url, String title,
|
public Feed subscribe(User user, String url, String title,
|
||||||
FeedCategory category) {
|
FeedCategory category) {
|
||||||
|
|
||||||
@@ -83,7 +90,8 @@ public class FeedSubscriptionService {
|
|||||||
if (newSubscription) {
|
if (newSubscription) {
|
||||||
try {
|
try {
|
||||||
List<FeedEntryStatus> statuses = Lists.newArrayList();
|
List<FeedEntryStatus> statuses = Lists.newArrayList();
|
||||||
List<FeedEntry> allEntries = feedEntryDAO.findByFeed(feed, 0, 10);
|
List<FeedEntry> allEntries = feedEntryDAO.findByFeed(feed, 0,
|
||||||
|
10);
|
||||||
for (FeedEntry entry : allEntries) {
|
for (FeedEntry entry : allEntries) {
|
||||||
FeedEntryStatus status = new FeedEntryStatus();
|
FeedEntryStatus status = new FeedEntryStatus();
|
||||||
status.setEntry(entry);
|
status.setEntry(entry);
|
||||||
@@ -93,10 +101,22 @@ public class FeedSubscriptionService {
|
|||||||
}
|
}
|
||||||
feedEntryStatusDAO.saveOrUpdate(statuses);
|
feedEntryStatusDAO.saveOrUpdate(statuses);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("could not fetch initial statuses when importing {} : {}", feed.getUrl(), e.getMessage());
|
log.error(
|
||||||
|
"could not fetch initial statuses when importing {} : {}",
|
||||||
|
feed.getUrl(), e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taskGiver.add(feed);
|
taskGiver.add(feed);
|
||||||
return feed;
|
return feed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Long, Long> getUnreadCount(User user) {
|
||||||
|
Map<Long, Long> map = cache.getUnreadCounts(user);
|
||||||
|
if (map == null) {
|
||||||
|
log.debug("unread count cache miss for {}", Models.getId(user));
|
||||||
|
map = feedEntryStatusDAO.getUnreadCount(user);
|
||||||
|
cache.setUnreadCounts(user, map);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class FeedUpdateService {
|
|||||||
|
|
||||||
users.add(sub.getUser());
|
users.add(sub.getUser());
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(users.toArray(new User[0]));
|
cache.invalidateUserData(users.toArray(new User[0]));
|
||||||
feedEntryDAO.saveOrUpdate(update);
|
feedEntryDAO.saveOrUpdate(update);
|
||||||
feedEntryStatusDAO.saveOrUpdate(statusUpdateList);
|
feedEntryStatusDAO.saveOrUpdate(statusUpdateList);
|
||||||
metricsBean.entryUpdated(statusUpdateList.size());
|
metricsBean.entryUpdated(statusUpdateList.size());
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.commafeed.backend.model.FeedSubscription;
|
|||||||
import com.commafeed.backend.model.User;
|
import com.commafeed.backend.model.User;
|
||||||
import com.commafeed.backend.model.UserRole.Role;
|
import com.commafeed.backend.model.UserRole.Role;
|
||||||
import com.commafeed.backend.model.UserSettings.ReadingOrder;
|
import com.commafeed.backend.model.UserSettings.ReadingOrder;
|
||||||
|
import com.commafeed.backend.services.FeedSubscriptionService;
|
||||||
import com.commafeed.frontend.SecurityCheck;
|
import com.commafeed.frontend.SecurityCheck;
|
||||||
import com.commafeed.frontend.model.Category;
|
import com.commafeed.frontend.model.Category;
|
||||||
import com.commafeed.frontend.model.Entries;
|
import com.commafeed.frontend.model.Entries;
|
||||||
@@ -73,6 +74,9 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
@Inject
|
@Inject
|
||||||
FeedSubscriptionDAO feedSubscriptionDAO;
|
FeedSubscriptionDAO feedSubscriptionDAO;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
FeedSubscriptionService feedSubscriptionService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
CacheService cache;
|
CacheService cache;
|
||||||
|
|
||||||
@@ -231,7 +235,7 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
feedEntryStatusDAO.markCategoryEntries(getUser(), categories,
|
feedEntryStatusDAO.markCategoryEntries(getUser(), categories,
|
||||||
olderThan);
|
olderThan);
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +258,7 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
cat.setParent(parent);
|
cat.setParent(parent);
|
||||||
}
|
}
|
||||||
feedCategoryDAO.saveOrUpdate(cat);
|
feedCategoryDAO.saveOrUpdate(cat);
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +289,7 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
feedCategoryDAO.saveOrUpdate(categories);
|
feedCategoryDAO.saveOrUpdate(categories);
|
||||||
|
|
||||||
feedCategoryDAO.delete(cat);
|
feedCategoryDAO.delete(cat);
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
} else {
|
} else {
|
||||||
return Response.status(Status.NOT_FOUND).build();
|
return Response.status(Status.NOT_FOUND).build();
|
||||||
@@ -350,7 +354,7 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
}
|
}
|
||||||
|
|
||||||
feedCategoryDAO.saveOrUpdate(category);
|
feedCategoryDAO.saveOrUpdate(category);
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +372,7 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
}
|
}
|
||||||
category.setCollapsed(req.isCollapse());
|
category.setCollapsed(req.isCollapse());
|
||||||
feedCategoryDAO.saveOrUpdate(category);
|
feedCategoryDAO.saveOrUpdate(category);
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,7 +381,7 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
@ApiOperation(value = "Get unread count for feed subscriptions", responseClass = "List[com.commafeed.frontend.model.UnreadCount]")
|
@ApiOperation(value = "Get unread count for feed subscriptions", responseClass = "List[com.commafeed.frontend.model.UnreadCount]")
|
||||||
public Response getUnreadCount() {
|
public Response getUnreadCount() {
|
||||||
List<UnreadCount> list = Lists.newArrayList();
|
List<UnreadCount> list = Lists.newArrayList();
|
||||||
Map<Long, Long> unreadCount = feedEntryStatusDAO
|
Map<Long, Long> unreadCount = feedSubscriptionService
|
||||||
.getUnreadCount(getUser());
|
.getUnreadCount(getUser());
|
||||||
for (Map.Entry<Long, Long> e : unreadCount.entrySet()) {
|
for (Map.Entry<Long, Long> e : unreadCount.entrySet()) {
|
||||||
list.add(new UnreadCount(e.getKey(), e.getValue()));
|
list.add(new UnreadCount(e.getKey(), e.getValue()));
|
||||||
@@ -397,11 +401,10 @@ public class CategoryREST extends AbstractResourceREST {
|
|||||||
List<FeedCategory> categories = feedCategoryDAO.findAll(user);
|
List<FeedCategory> categories = feedCategoryDAO.findAll(user);
|
||||||
List<FeedSubscription> subscriptions = feedSubscriptionDAO
|
List<FeedSubscription> subscriptions = feedSubscriptionDAO
|
||||||
.findAll(getUser());
|
.findAll(getUser());
|
||||||
Map<Long, Long> unreadCount = feedEntryStatusDAO
|
Map<Long, Long> unreadCount = feedSubscriptionService
|
||||||
.getUnreadCount(getUser());
|
.getUnreadCount(getUser());
|
||||||
|
|
||||||
root = buildCategory(null, categories, subscriptions,
|
root = buildCategory(null, categories, subscriptions, unreadCount);
|
||||||
unreadCount);
|
|
||||||
root.setId("all");
|
root.setId("all");
|
||||||
root.setName("All");
|
root.setName("All");
|
||||||
cache.setRootCategory(user, root);
|
cache.setRootCategory(user, root);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class EntryREST extends AbstractResourceREST {
|
|||||||
|
|
||||||
feedEntryService.markEntry(getUser(), Long.valueOf(req.getId()),
|
feedEntryService.markEntry(getUser(), Long.valueOf(req.getId()),
|
||||||
req.getFeedId(), req.isRead());
|
req.getFeedId(), req.isRead());
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ public class FeedREST extends AbstractResourceREST {
|
|||||||
if (subscription != null) {
|
if (subscription != null) {
|
||||||
feedEntryStatusDAO.markSubscriptionEntries(subscription, olderThan);
|
feedEntryStatusDAO.markSubscriptionEntries(subscription, olderThan);
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ public class FeedREST extends AbstractResourceREST {
|
|||||||
.entity("Failed to subscribe to URL " + url + ": "
|
.entity("Failed to subscribe to URL " + url + ": "
|
||||||
+ e.getMessage()).build();
|
+ e.getMessage()).build();
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ public class FeedREST extends AbstractResourceREST {
|
|||||||
req.getId());
|
req.getId());
|
||||||
if (sub != null) {
|
if (sub != null) {
|
||||||
feedSubscriptionDAO.delete(sub);
|
feedSubscriptionDAO.delete(sub);
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
} else {
|
} else {
|
||||||
return Response.status(Status.NOT_FOUND).build();
|
return Response.status(Status.NOT_FOUND).build();
|
||||||
@@ -484,7 +484,7 @@ public class FeedREST extends AbstractResourceREST {
|
|||||||
} else {
|
} else {
|
||||||
feedSubscriptionDAO.saveOrUpdate(subscription);
|
feedSubscriptionDAO.saveOrUpdate(subscription);
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -523,7 +523,7 @@ public class FeedREST extends AbstractResourceREST {
|
|||||||
.status(Status.INTERNAL_SERVER_ERROR)
|
.status(Status.INTERNAL_SERVER_ERROR)
|
||||||
.entity(e.getMessage()).build());
|
.entity(e.getMessage()).build());
|
||||||
}
|
}
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.temporaryRedirect(
|
return Response.temporaryRedirect(
|
||||||
URI.create(applicationSettingsService.get().getPublicUrl()))
|
URI.create(applicationSettingsService.get().getPublicUrl()))
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ public class UserREST extends AbstractResourceREST {
|
|||||||
return Response.status(Status.FORBIDDEN).build();
|
return Response.status(Status.FORBIDDEN).build();
|
||||||
}
|
}
|
||||||
userService.unregister(getUser());
|
userService.unregister(getUser());
|
||||||
cache.invalidateRootCategory(getUser());
|
cache.invalidateUserData(getUser());
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user