*) Trying to solve pool not open problem

See: http://www.yacy-forum.de/viewtopic.php?t=1798

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1482 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent a6245a302f
commit ab7a911bb3

@ -152,21 +152,28 @@ public final class plasmaCrawlStacker {
public void job() { public void job() {
try { try {
// getting a new message from the crawler queue // getting a new message from the crawler queue
if (Thread.currentThread().isInterrupted()) return;
stackCrawlMessage theMsg = this.queue.waitForMessage(); stackCrawlMessage theMsg = this.queue.waitForMessage();
// getting a free session thread from the pool // getting a free session thread from the pool
if (Thread.currentThread().isInterrupted()) return;
Worker worker = (Worker) this.theWorkerPool.borrowObject(); Worker worker = (Worker) this.theWorkerPool.borrowObject();
// processing the new request // processing the new request
worker.execute(theMsg); worker.execute(theMsg);
} catch (InterruptedException e) { } catch (Exception e) {
Thread.interrupted(); if (e instanceof InterruptedException) {
//this.stopped = true; this.log.logFine("Interruption detected.");
} } else if ((e instanceof IllegalStateException) &&
catch (Exception e) { (e.getMessage() != null) &&
(e.getMessage().indexOf("Pool not open") >= -1)) {
this.log.logFine("Pool was closed.");
} else {
this.log.logSevere("plasmaStackCrawlThread.run/loop", e); this.log.logSevere("plasmaStackCrawlThread.run/loop", e);
} }
} }
}
public void enqueue( public void enqueue(
String nexturlString, String nexturlString,

Loading…
Cancel
Save