From 61e015268b1663163ca6c929a14dadd4ed64eb30 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Thu, 25 Jul 2013 09:53:19 +0200 Subject: [PATCH] fix in forced deletion: forced commit needed --- source/net/yacy/search/Switchboard.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index e15f1cae1..927f60efb 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -2875,7 +2875,6 @@ public final class Switchboard extends serverSwitch { * @param url * @return null if this was ok. If this failed, return a string with a fail reason */ - @SuppressWarnings("deprecation") public String stackUrl(CrawlProfile profile, DigestURI url) { byte[] handle = ASCII.getBytes(profile.handle()); @@ -2887,10 +2886,12 @@ public final class Switchboard extends serverSwitch { // stacking may fail because of double occurrences of that url. Therefore // we must wait here until the url has actually disappeared int t = 100; - while (t-- > 0 && this.index.exists(ASCII.String(urlhash))) { + Collection ids = new ArrayList(1); ids.add(ASCII.String(urlhash)); + while (t-- > 0 && this.index.exists(ids).size() > 0) { try {Thread.sleep(100);} catch (final InterruptedException e) {} ConcurrentLog.fine("Switchboard", "STACKURL: waiting for deletion, t=" + t); if (t == 20) this.index.fulltext().commit(true); + if (t == 40) this.index.fulltext().commit(false); } // special handling of ftp protocol