public Optional<String> startAsyncJob(String jobType){
  try {
    final JobRunnable jobRunnable=findJobRunnable(jobType);
    JobInfo jobInfo=createJobInfo(jobType);
    repository.markJobAsRunningIfPossible(jobInfo,mutexJobTypesFor(jobType));
    repository.createOrUpdate(jobInfo);
    return Optional.of(startAsync(metered(jobRunnable),jobInfo.getJobId()));
  }
 catch (  JobBlockedException e) {
    LOG.info(e.getMessage());
    return Optional.empty();
  }
}

public Optional < String > startAsyncJob ( String jobType ) { try { final JobRunnable jobRunnable = findJobRunnable ( jobType ) ; JobInfo jobInfo = createJobInfo ( jobType ) ; repository . markJobAsRunningIfPossible ( jobInfo , mutexJobTypesFor ( jobType ) ) ; repository . createOrUpdate ( jobInfo ) ; return Optional . of ( startAsync ( metered ( jobRunnable ) , jobInfo . getJobId ( ) ) ) ; } catch ( JobBlockedException e ) { LOG . info ( e . getMessage ( ) ) ; return Optional . empty ( ) ; } }
starts a job asynchronously in the background .
