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: us...@infra.apache.org With regards, Apache Git Services