fix for deadlock

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6246 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent fbfdaf063d
commit 0575f12838

@ -83,10 +83,12 @@ public class CrawlQueues {
delegatedURL = new ZURL(plasmaPath, "urlDelegated3.db", true);
}
/**
* tests if hash occurrs in any database
* @param hash
* @return if the hash exists, the name of the database is returned, otherwise null is returned
*/
public String urlExists(final String hash) {
// tests if hash occurrs in any database
// if it exists, the name of the database is returned,
// if it not exists, null is returned
if (delegatedURL.exists(hash)) return "delegated";
if (errorURL.exists(hash)) return "errors";
for (final crawlWorker worker: workers.values()) {

@ -254,9 +254,9 @@ public final class CrawlStacker {
}
// check if the url is double registered
final String dbocc = nextQueue.urlExists(entry.url().hash());
if (dbocc != null || indexSegment.urlMetadata().exists(entry.url().hash())) {
final URLMetadataRow oldEntry = indexSegment.urlMetadata().load(entry.url().hash(), null, 0);
final String dbocc = nextQueue.urlExists(entry.url().hash()); // returns the name of the queue if entry exists
URLMetadataRow oldEntry = null;
if (dbocc != null || (oldEntry = indexSegment.urlMetadata().load(entry.url().hash(), null, 0)) != null) {
final boolean recrawl = (oldEntry != null) && (profile.recrawlIfOlder() > oldEntry.loaddate().getTime());
// do double-check
if ((dbocc != null) && (!recrawl)) {

@ -30,7 +30,6 @@ import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import de.anomic.crawler.CrawlProfile.entry;
import de.anomic.document.Word;
import de.anomic.kelondro.util.FileUtils;
import de.anomic.kelondro.util.kelondroException;

@ -76,7 +76,6 @@ public class ReferenceContainerOrder<ReferenceType extends Reference> extends Ab
return this.embeddedOrder.cardinal(key);
}
@SuppressWarnings("unchecked")
public boolean equals(final Order<ReferenceContainer<ReferenceType>> otherOrder) {
if (!(otherOrder instanceof ReferenceContainerOrder)) return false;
return this.embeddedOrder.equals(((ReferenceContainerOrder<ReferenceType>) otherOrder).embeddedOrder);

Loading…
Cancel
Save