public static void jobstatus(final String name) { if (StringUtils.isNotBlank(name)) { AbstractJob abstractJob = AbstractJob.find("byName", name).first(); abstractJob.setActive(!abstractJob.isActive()); abstractJob._save(); } jobs(); }
@Transactional(readOnly = true) public static void runjob(final String name) { if (StringUtils.isNotBlank(name)) { final List<Job> jobs = JobsPlugin.scheduledJobs; for (final Job job : jobs) { if (name.equalsIgnoreCase(job.getClass().getSimpleName())) { job.now(); } } } jobs(); }