Commit a03735ea by liuyu

Merge branch 'release' into 'master'

Release

See merge request !37
parents bad35d6f 397602f6
...@@ -64,9 +64,9 @@ public class TaskManager { ...@@ -64,9 +64,9 @@ public class TaskManager {
return; return;
} }
// 任务间隔过滤 // 任务间隔过滤
if (autoTask.isSplitFilter() && Objects.nonNull(autoTask.getGroup())) { if (Objects.nonNull(autoTask.isSplitFilter()) && Objects.nonNull(autoTask.getGroup())) {
String runningKey = concat(GenericAttribute.RUNNING, autoTask.getGroup()); String runningKey = concat(GenericAttribute.RUNNING, autoTask.getGroup());
if (Objects.nonNull(redissonUtil.getBucket(runningKey))) { if (Objects.nonNull(redissonUtil.getBucket(runningKey)) && !autoTask.isSplitFilter()) {
log.info("有同类型任务正在执行中:{}", autoTask.getGroup()); log.info("有同类型任务正在执行中:{}", autoTask.getGroup());
return; return;
} }
......
...@@ -8,7 +8,10 @@ public class AutoTask { ...@@ -8,7 +8,10 @@ public class AutoTask {
private String group; private String group;
private boolean splitFilter; /**
* 间隔过滤:null不过滤,true优先级最高,false优先级低
*/
private Boolean splitFilter;
private String type; private String type;
...@@ -17,7 +20,7 @@ public class AutoTask { ...@@ -17,7 +20,7 @@ public class AutoTask {
public AutoTask(String type, String group) { public AutoTask(String type, String group) {
this.type = type; this.type = type;
this.group = group; this.group = group;
this.splitFilter = false; this.splitFilter = null;
this.paramSource = new JSONObject(); this.paramSource = new JSONObject();
} }
...@@ -53,11 +56,11 @@ public class AutoTask { ...@@ -53,11 +56,11 @@ public class AutoTask {
this.group = group; this.group = group;
} }
public boolean isSplitFilter() { public Boolean isSplitFilter() {
return splitFilter; return splitFilter;
} }
public void setSplitFilter(boolean splitFilter) { public void setSplitFilter(Boolean splitFilter) {
this.splitFilter = splitFilter; this.splitFilter = splitFilter;
} }
} }
...@@ -46,7 +46,7 @@ public class ScheduledMission { ...@@ -46,7 +46,7 @@ public class ScheduledMission {
calendarEndTime.add(Calendar.MINUTE, -5); calendarEndTime.add(Calendar.MINUTE, -5);
long endTime = calendarEndTime.getTime().getTime(); long endTime = calendarEndTime.getTime().getTime();
for (String project : asyncTask.findAllGroup()) { for (String project : asyncTask.findAllGroup()) {
putTask(project, startTime, endTime, true); putTask(project, startTime, endTime, false);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("十分钟定时同步模板失败:", e); log.error("十分钟定时同步模板失败:", e);
...@@ -64,10 +64,9 @@ public class ScheduledMission { ...@@ -64,10 +64,9 @@ public class ScheduledMission {
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
for (String project : asyncTask.findAllGroup()) { for (String project : asyncTask.findAllGroup()) {
//模板聚合任务 //模板聚合任务
putTask(project, startTime, endTime, false); putTask(project, startTime, endTime, true);
putTaskBy(project); putTaskBy(project);
} }
// 模板记录清除任务 // 模板记录清除任务
putTaskByRecord(); putTaskByRecord();
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment