taskDefinition.setStatus(TaskDefinition.PAUSED);
return;
}
/* 启动任务 */
Handler handler = taskDefinition.getHandler();
if(handler == null){
log.error("There is no handler to process!");
return;
}
handler.setConfig(config);
ScheduledFuture<?> future = service.scheduleWithFixedDelay(handler, 0, taskDefinition.getFrequency(), TimeUnit.MILLISECONDS);
taskDefinition.setFuture(future);
taskDefinition.setStatus(TaskDefinition.OPENED); // 修改业务状态为运行中
log.info("Task {"+taskId+"} is opened!");
} catch (Exception e) {