diff --git a/htroot/News.java b/htroot/News.java index 96dafaf79..ba522e749 100644 --- a/htroot/News.java +++ b/htroot/News.java @@ -92,14 +92,14 @@ public class News { } yacyNewsRecord record; try { - if ((tableID == yacyNewsPool.PROCESSED_DB) || (tableID == yacyNewsPool.PUBLISHED_DB)) { - yacyCore.newsPool.clear(tableID); - } else { +// if ((tableID == yacyNewsPool.PROCESSED_DB) || (tableID == yacyNewsPool.PUBLISHED_DB)) { +// yacyCore.newsPool.clear(tableID); +// } else { while (yacyCore.newsPool.size(tableID) > 0) { record = yacyCore.newsPool.get(tableID, 0); yacyCore.newsPool.moveOff(tableID, record.id()); } - } +// } } catch (IOException e) { e.printStackTrace(); } diff --git a/source/de/anomic/yacy/yacyNewsPool.java b/source/de/anomic/yacy/yacyNewsPool.java index c8e88376f..22cf08f62 100644 --- a/source/de/anomic/yacy/yacyNewsPool.java +++ b/source/de/anomic/yacy/yacyNewsPool.java @@ -304,8 +304,19 @@ public class yacyNewsPool { private boolean moveOff(yacyNewsQueue fromqueue, yacyNewsQueue toqueue, String id) throws IOException { // called if a published news shall be removed yacyNewsRecord record = fromqueue.remove(id); - if (record == null) return false; + if (record == null) { + System.out.println("DEBUG: record == null"); + return false; + } if (toqueue != null) toqueue.push(record); + else if ((incomingNews.get(id) == null) && (processedNews.get(id) == null) && (outgoingNews.get(id) == null) && (publishedNews.get(id) == null)){ + newsDB.remove(id); + System.out.println("DEBUG: News-ID " + id + " deleted"); + } + if (incomingNews.get(id) != null) System.out.println("DEBUG: News-ID " + id + " in incomingNews"); + if (processedNews.get(id) != null) System.out.println("DEBUG: News-ID " + id + " in processedNews"); + if (outgoingNews.get(id) != null) System.out.println("DEBUG: News-ID " + id + " in outgoingNews"); + if (publishedNews.get(id) != null) System.out.println("DEBUG: News-ID " + id + " in publishedNews"); return true; }