Commit 93c4a2af authored by Yihua Huang's avatar Yihua Huang

Merge pull request #102 from ccliangbo/waitNewUrl

combine two try-catch block into one, make it cleaner.
parents c8014a9a 163773af
......@@ -489,17 +489,17 @@ public class Spider implements Runnable, Task {
}
private void waitNewUrl() {
try {
newUrlLock.lock();
try {
//double check
if (threadAlive.get() == 0 && exitWhenComplete) {
return;
}
try {
newUrlCondition.await();
} catch (InterruptedException e) {
logger.warn("waitNewUrl - interrupted, error {}", e);
}
} finally {
finally {
newUrlLock.unlock();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment