From 9bc3e457dd8fdc40f09f4a1a6f717ed44e2129d7 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 5 Aug 2014 22:23:52 +0200 Subject: [PATCH] fix for termination of all crawls --- htroot/Crawler_p.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.java index 316c4e118..04e24886f 100644 --- a/htroot/Crawler_p.java +++ b/htroot/Crawler_p.java @@ -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 */}