Skip to content

Commit

Permalink
fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ihaolin committed Aug 10, 2017
1 parent e453264 commit 489af2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public JobResult execute(JobContext context) {
System.out.println("DemoJobA start...");
System.out.println("context: " + context);

Sleeps.sleep(random.nextInt(5) + 1);
Sleeps.sleep(random.nextInt(10) + 1);

System.out.println("DemoJobA end...");

Expand Down
7 changes: 4 additions & 3 deletions antares-demo/src/main/resources/antares-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

<!-- Spring Antares Client -->
<bean class="me.hao0.antares.client.core.SpringAntaresClient">
<constructor-arg index="0" value="demo_app" />
<constructor-arg index="0" value="myapp" />
<constructor-arg index="1" value="123456" />
<constructor-arg index="2" value="${antares.zk}" />
<property name="executorThreadCount" value="32" />
<constructor-arg index="2" value="localhost:2181" />
<constructor-arg index="3" value="ats" />
<property name="executorThreadCount" value="8" />
</bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void execute(final JobDetail jobDetail, JobTriggerType triggerType, JobEx
// blocking until all shards to be finished or timeout
Long timeout = jobDetail.getConfig().getTimeout();
timeout = timeout == null ? 0L : timeout;
JobInstanceWaitResp finishResp = jobSupport.waitingJobInstanceFinish(appName, jobClass, timeout, instance.getId());
JobInstanceWaitResp finishResp = jobSupport.waitingJobInstanceFinish(appName, jobClass, instance.getId(), timeout);
if (finishResp.isSuccess()){
// job instance is finished successfully
// publish job finish event
Expand Down

0 comments on commit 489af2f

Please sign in to comment.