You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@griffin.apache.org by GitBox <gi...@apache.org> on 2019/04/01 09:03:07 UTC

[GitHub] [griffin] aborgatin commented on a change in pull request #489: GRIFFIN-240 Return JobInstanceBean in response to a call Trigger job by id

aborgatin commented on a change in pull request #489: GRIFFIN-240 Return JobInstanceBean in response to a call Trigger job by id
URL: https://github.com/apache/griffin/pull/489#discussion_r270773676
 
 

 ##########
 File path: service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java
 ##########
 @@ -666,9 +669,28 @@ public void triggerJobById(Long id) throws SchedulerException {
                     .forJob(jobKey)
                     .startNow()
                     .build();
+            TriggerKey key = trigger.getKey();
+            CountDownLatch latch = new CountDownLatch(1);
+            scheduler.getListenerManager().addTriggerListener(
+                    new CountDownTriggerListener(latch, "listenerJob_" + jobKey.toString())
+                    , key::equals);
+
             scheduler.scheduleJob(trigger);
+
+            try {
+                latch.await(timeout, TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                LOGGER.warn("CountDownLatch awaiting is interrupted");
+            }
+            List<JobInstanceBean> instanceBeans = instanceRepo.findByTriggerName(key.toString());
 
 Review comment:
   Yes, it is a full scan

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services