|
|
|
@ -189,11 +189,11 @@ public class XxlJobServiceImpl implements XxlJobService {
|
|
|
|
|
return new ReturnT<String>(ReturnT.FAIL_CODE, (I18nUtil.getString("jobinfo_field_id")+I18nUtil.getString("system_not_found")) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// next trigger time (10s后生效,避开预读周期)
|
|
|
|
|
// next trigger time (5s后生效,避开预读周期)
|
|
|
|
|
long nextTriggerTime = exists_jobInfo.getTriggerNextTime();
|
|
|
|
|
if (exists_jobInfo.getTriggerStatus() == 1 && !jobInfo.getJobCron().equals(exists_jobInfo.getJobCron()) ) {
|
|
|
|
|
try {
|
|
|
|
|
nextTriggerTime = new CronExpression(jobInfo.getJobCron()).getNextValidTimeAfter(new Date(System.currentTimeMillis() + 10000)).getTime();
|
|
|
|
|
nextTriggerTime = new CronExpression(jobInfo.getJobCron()).getNextValidTimeAfter(new Date(System.currentTimeMillis() + 5000)).getTime();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
|
return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("jobinfo_field_cron_unvalid")+" | "+ e.getMessage());
|
|
|
|
@ -236,10 +236,10 @@ public class XxlJobServiceImpl implements XxlJobService {
|
|
|
|
|
public ReturnT<String> start(int id) {
|
|
|
|
|
XxlJobInfo xxlJobInfo = xxlJobInfoDao.loadById(id);
|
|
|
|
|
|
|
|
|
|
// next trigger time (10s后生效,避开预读周期)
|
|
|
|
|
// next trigger time (5s后生效,避开预读周期)
|
|
|
|
|
long nextTriggerTime = 0;
|
|
|
|
|
try {
|
|
|
|
|
nextTriggerTime = new CronExpression(xxlJobInfo.getJobCron()).getNextValidTimeAfter(new Date(System.currentTimeMillis() + 10000)).getTime();
|
|
|
|
|
nextTriggerTime = new CronExpression(xxlJobInfo.getJobCron()).getNextValidTimeAfter(new Date(System.currentTimeMillis() + 5000)).getTime();
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
|
return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("jobinfo_field_cron_unvalid")+" | "+ e.getMessage());
|
|
|
|
|