fix #420 : add remote debug option
This commit is contained in:
parent
6d64a84865
commit
61ae042941
1 changed files with 15 additions and 0 deletions
|
@ -72,6 +72,8 @@ public class CrawlJob {
|
|||
|
||||
protected boolean useLocalElasticsearch = true;
|
||||
|
||||
protected String remoteDebug;
|
||||
|
||||
public CrawlJob jobExecutor(final JobExecutor jobExecutor) {
|
||||
this.jobExecutor = jobExecutor;
|
||||
return this;
|
||||
|
@ -133,6 +135,15 @@ public class CrawlJob {
|
|||
return this;
|
||||
}
|
||||
|
||||
public CrawlJob remoteDebug() {
|
||||
return remoteDebug("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=127.0.0.1:8000");
|
||||
}
|
||||
|
||||
public CrawlJob remoteDebug(String option) {
|
||||
this.remoteDebug = option;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String execute(final JobExecutor jobExecutor) {
|
||||
jobExecutor(jobExecutor);
|
||||
return execute();
|
||||
|
@ -316,6 +327,10 @@ public class CrawlJob {
|
|||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isNotBlank(remoteDebug)) {
|
||||
StreamUtil.of(remoteDebug.split(" ")).filter(s -> StringUtil.isNotBlank(s)).forEach(s -> cmdList.add(s));
|
||||
}
|
||||
|
||||
cmdList.add(Crawler.class.getCanonicalName());
|
||||
|
||||
cmdList.add("--sessionId");
|
||||
|
|
Loading…
Add table
Reference in a new issue