when a new crawl is started, an equal crawl, if still running, is

terminated and the corresponding crawl profile is deleted (this also
clears the crawl queue entries for that crawl profile)
pull/1/head
Michael Peter Christen 12 years ago
parent 906e51214a
commit 85ca07b90e

@ -372,6 +372,12 @@ public class Crawler_p {
collection);
byte[] handle = ASCII.getBytes(profile.handle());
// before we fire up a new crawl, we make sure that another crawl with the same name is not running
sb.crawler.removeActive(handle);
sb.crawler.removePassive(handle);
try {sb.crawlQueues.noticeURL.removeByProfileHandle(profile.handle(), 10000);} catch (SpaceExceededException e1) {}
// start the crawl
if ("url".equals(crawlingMode)) {
if (rootURLs.size() == 0) {
prop.put("info", "5"); //Crawling failed

@ -155,7 +155,7 @@ public class CrawlProfile extends ConcurrentHashMap<String, String> implements M
if (name == null || name.isEmpty()) {
throw new NullPointerException("name must not be null or empty");
}
if (name.length() > 60) name = name.substring(0, 60);
if (name.length() > 256) name = name.substring(256);
this.doms = new ConcurrentHashMap<String, DomProfile>();
final String handle = Base64Order.enhancedCoder.encode(Digest.encodeMD5Raw(name)).substring(0, Word.commonHashLength);
put(HANDLE, handle);

Loading…
Cancel
Save