fix for termination of all crawls

pull/1/head
Michael Peter Christen 11 years ago
parent 66106bdaf0
commit 9bc3e457dd

@ -125,6 +125,16 @@ public class Crawler_p {
}
if (post != null && post.containsKey("queues_terminate_all")) {
// terminate crawls individually
for (final byte[] h: sb.crawler.getActive()) {
CrawlProfile p = sb.crawler.getActive(h);
if (CrawlSwitchboard.DEFAULT_PROFILES.contains(p.name())) continue;
if (p != null) sb.crawler.putPassive(h, p);
sb.crawler.removeActive(h);
sb.crawler.removePassive(h);
try {sb.crawlQueues.noticeURL.removeByProfileHandle(p.handle(), 10000);} catch (SpaceExceededException e) {}
}
// clear stacks
for (StackType stackType: StackType.values()) sb.crawlQueues.noticeURL.clear(stackType);
try { sb.cleanProfiles(); } catch (final InterruptedException e) {/* ignore this */}

Loading…
Cancel
Save