use of core.framework.scheduler.Job in project core-ng-project by neowu.
the class Scheduler method submitJob.
void submitJob(Trigger trigger, boolean trace) {
jobExecutor.submit(() -> {
try {
ActionLog actionLog = logManager.begin("=== job execution begin ===");
String name = trigger.name();
actionLog.action("job:" + name);
if (trace) {
actionLog.trace = true;
}
Job job = trigger.job();
actionLog.context("job", name);
actionLog.context("jobClass", job.getClass().getCanonicalName());
job.execute();
return null;
} catch (Throwable e) {
logManager.logError(e);
throw e;
} finally {
logManager.end("=== job execution end ===");
}
});
}