mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
split cleanup into two methods
This commit is contained in:
@@ -193,12 +193,20 @@ public class AdminREST extends AbstractResourceREST {
|
|||||||
return Response.ok(map).build();
|
return Response.ok(map).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Path("/cleanup")
|
@Path("/cleanup/feeds")
|
||||||
@GET
|
@GET
|
||||||
public Response cleanup(@QueryParam("days") @DefaultValue("30") int days) {
|
public Response cleanupFeeds() {
|
||||||
Map<String, Long> map = Maps.newHashMap();
|
Map<String, Long> map = Maps.newHashMap();
|
||||||
map.put("feeds_without_subscriptions",
|
map.put("feeds_without_subscriptions",
|
||||||
cleaner.cleanFeedsWithoutSubscriptions());
|
cleaner.cleanFeedsWithoutSubscriptions());
|
||||||
|
return Response.ok(map).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Path("/cleanup/entries")
|
||||||
|
@GET
|
||||||
|
public Response cleanupEntries(
|
||||||
|
@QueryParam("days") @DefaultValue("30") int days) {
|
||||||
|
Map<String, Long> map = Maps.newHashMap();
|
||||||
map.put("old entries",
|
map.put("old entries",
|
||||||
cleaner.cleanEntriesOlderThan(days, TimeUnit.DAYS));
|
cleaner.cleanEntriesOlderThan(days, TimeUnit.DAYS));
|
||||||
return Response.ok(map).build();
|
return Response.ok(map).build();
|
||||||
|
|||||||
Reference in New Issue
Block a user