|
31 | 31 | import org.codelibs.fess.crawler.client.http.RequestHeader;
|
32 | 32 | import org.codelibs.fess.crawler.client.http.impl.AuthenticationImpl;
|
33 | 33 | import org.codelibs.fess.crawler.client.http.ntlm.JcifsEngine;
|
34 |
| -import org.codelibs.fess.crawler.exception.EsAccessException; |
35 | 34 | import org.codelibs.riverweb.app.service.ScriptService;
|
36 | 35 | import org.codelibs.riverweb.entity.RiverConfig;
|
37 | 36 | import org.codelibs.riverweb.interval.WebRiverIntervalController;
|
@@ -176,6 +175,7 @@ private int execute() {
|
176 | 175 | if (configId instanceof String) {
|
177 | 176 | print("Config %s is started with Session %s.", configId, sessionId);
|
178 | 177 | try {
|
| 178 | + crawler = SingletonLaContainer.getComponent(Crawler.class); |
179 | 179 | crawl(configId.toString(), sessionId);
|
180 | 180 | } finally {
|
181 | 181 | print("Config %s is finished.", configId);
|
@@ -359,15 +359,23 @@ private int crawl(String configId, String sessionId) {
|
359 | 359 | final List<String> includeFilterList = (List<String>) crawlSettings.get("include_urls");
|
360 | 360 | if (includeFilterList != null) {
|
361 | 361 | for (final String regex : includeFilterList) {
|
362 |
| - crawler.addIncludeFilter(regex); |
| 362 | + try { |
| 363 | + crawler.addIncludeFilter(regex); |
| 364 | + } catch (DocumentAlreadyExistsException e) { |
| 365 | + logger.warn(regex + " exists in " + sessionId); |
| 366 | + } |
363 | 367 | }
|
364 | 368 | }
|
365 | 369 | // exclude regex
|
366 | 370 | @SuppressWarnings("unchecked")
|
367 | 371 | final List<String> excludeFilterList = (List<String>) crawlSettings.get("exclude_urls");
|
368 | 372 | if (excludeFilterList != null) {
|
369 | 373 | for (final String regex : excludeFilterList) {
|
370 |
| - crawler.addExcludeFilter(regex); |
| 374 | + try { |
| 375 | + crawler.addExcludeFilter(regex); |
| 376 | + } catch (DocumentAlreadyExistsException e) { |
| 377 | + logger.warn(regex + " exists in " + sessionId); |
| 378 | + } |
371 | 379 | }
|
372 | 380 | }
|
373 | 381 |
|
|
0 commit comments