From 08057f7fdbf474ecf2bf2e7e353a378aeb981200 Mon Sep 17 00:00:00 2001 From: trydofor Date: Fri, 21 Jun 2024 16:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20check=20TinyTasker=20uniq=20propkey?= =?UTF-8?q?=20#260?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- observe/mirana | 2 +- .../autogen/tables/WinTaskResultTable.java | 29 ++-- .../autogen/tables/daos/WinTaskResultDao.java | 33 +++- .../tables/interfaces/IWinTaskResult.java | 13 +- .../autogen/tables/pojos/WinTaskResult.java | 100 +++++++++++- .../tables/records/WinTaskResultRecord.java | 145 +++++++++++------- .../tiny/task/schedule/exec/ExecHolder.java | 26 ++-- .../task/service/TinyTaskConfService.java | 1 + .../tiny/task/service/TinyTaskService.java | 1 + .../service/impl/TinyTaskBeatServiceImpl.java | 2 - .../service/impl/TinyTaskConfServiceImpl.java | 46 +++--- .../service/impl/TinyTaskExecServiceImpl.java | 57 +++---- .../service/impl/TinyTaskServiceImpl.java | 4 +- .../spring/bean/TinyTaskConfiguration.java | 8 +- .../03-v32-130/2021-10-26u02-task-tune.sql | 1 + .../03-v32-130/2021-10-26v02-task-tune.sql | 5 + .../06-task/2020-10-26v01-tiny_task.sql | 1 + 17 files changed, 328 insertions(+), 146 deletions(-) diff --git a/observe/mirana b/observe/mirana index 6c3223ae7..4468526da 160000 --- a/observe/mirana +++ b/observe/mirana @@ -1 +1 @@ -Subproject commit 6c3223ae78fb6efb06d6e4e315ba8a580fad73c1 +Subproject commit 4468526dab95bb10df5bcabded576aeae224acd0 diff --git a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/WinTaskResultTable.java b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/WinTaskResultTable.java index 17228a271..7c5f57077 100644 --- a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/WinTaskResultTable.java +++ b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/WinTaskResultTable.java @@ -4,17 +4,12 @@ package pro.fessional.wings.tiny.task.database.autogen.tables; -import java.time.LocalDateTime; -import java.util.function.Function; - -import javax.annotation.processing.Generated; - import org.jetbrains.annotations.NotNull; import org.jooq.Field; -import org.jooq.Function9; +import org.jooq.Function10; import org.jooq.Name; import org.jooq.Records; -import org.jooq.Row9; +import org.jooq.Row10; import org.jooq.Schema; import org.jooq.SelectField; import org.jooq.Table; @@ -25,12 +20,15 @@ import org.jooq.impl.Internal; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; - import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import pro.fessional.wings.faceless.service.lightid.LightIdAware; import pro.fessional.wings.tiny.task.database.autogen.DefaultSchemaTinyTask; import pro.fessional.wings.tiny.task.database.autogen.tables.records.WinTaskResultRecord; +import javax.annotation.processing.Generated; +import java.time.LocalDateTime; +import java.util.function.Function; + /** * The table wings.win_task_result. @@ -72,6 +70,11 @@ public Class getRecordType() { */ public final TableField TaskId = createField(DSL.name("task_id"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.inline("0", SQLDataType.BIGINT)), this, ""); + /** + * The column win_task_result.task_key. + */ + public final TableField TaskKey = createField(DSL.name("task_key"), SQLDataType.VARCHAR(200).nullable(false).defaultValue(DSL.inline("", SQLDataType.VARCHAR)), this, ""); + /** * The column win_task_result.task_app. */ @@ -186,18 +189,18 @@ public WinTaskResultTable rename(Table name) { } // ------------------------------------------------------------------------- - // Row9 type methods + // Row10 type methods // ------------------------------------------------------------------------- @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); } /** * Convenience mapping calling {@link SelectField#convertFrom(Function)}. */ - public SelectField mapping(Function9 from) { + public SelectField mapping(Function10 from) { return convertFrom(Records.mapping(from)); } @@ -205,7 +208,7 @@ public SelectField mapping(Function9 SelectField mapping(Class toType, Function9 from) { + public SelectField mapping(Class toType, Function10 from) { return convertFrom(toType, Records.mapping(from)); } diff --git a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java index e0af061b8..8498bcf76 100644 --- a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java +++ b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java @@ -4,23 +4,21 @@ package pro.fessional.wings.tiny.task.database.autogen.tables.daos; -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Optional; - -import javax.annotation.processing.Generated; - import org.jooq.Configuration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; - import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskResultTable; import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskResult; import pro.fessional.wings.tiny.task.database.autogen.tables.records.WinTaskResultRecord; +import javax.annotation.processing.Generated; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; +import java.util.Optional; + /** * The table wings.win_task_result. @@ -110,6 +108,25 @@ public List fetchByTaskId(Collection values) { return fetch(WinTaskResultTable.WinTaskResult.TaskId, values); } + /** + * Fetch records that have task_key BETWEEN lowerInclusive AND + * upperInclusive + */ + public List fetchRangeOfTaskKey(String lowerInclusive, String upperInclusive) { + return fetchRange(WinTaskResultTable.WinTaskResult.TaskKey, lowerInclusive, upperInclusive); + } + + /** + * Fetch records that have task_key IN (values) + */ + public List fetchByTaskKey(String... values) { + return fetch(WinTaskResultTable.WinTaskResult.TaskKey, values); + } + + public List fetchByTaskKey(Collection values) { + return fetch(WinTaskResultTable.WinTaskResult.TaskKey, values); + } + /** * Fetch records that have task_app BETWEEN lowerInclusive AND * upperInclusive diff --git a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/interfaces/IWinTaskResult.java b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/interfaces/IWinTaskResult.java index 42c99b618..268a8189e 100644 --- a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/interfaces/IWinTaskResult.java +++ b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/interfaces/IWinTaskResult.java @@ -4,11 +4,10 @@ package pro.fessional.wings.tiny.task.database.autogen.tables.interfaces; +import javax.annotation.processing.Generated; import java.io.Serializable; import java.time.LocalDateTime; -import javax.annotation.processing.Generated; - /** * The table wings.win_task_result. @@ -44,6 +43,16 @@ public interface IWinTaskResult extends Serializable { */ public Long getTaskId(); + /** + * Setter for win_task_result.task_key. + */ + public void setTaskKey(String value); + + /** + * Getter for win_task_result.task_key. + */ + public String getTaskKey(); + /** * Setter for win_task_result.task_app. */ diff --git a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/pojos/WinTaskResult.java b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/pojos/WinTaskResult.java index 08e9c9c14..4e2d20f72 100644 --- a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/pojos/WinTaskResult.java +++ b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/pojos/WinTaskResult.java @@ -4,16 +4,15 @@ package pro.fessional.wings.tiny.task.database.autogen.tables.pojos; +import pro.fessional.wings.tiny.task.database.autogen.tables.interfaces.IWinTaskResult; + +import javax.annotation.processing.Generated; import java.beans.Transient; import java.time.LocalDateTime; import java.util.function.Predicate; import java.util.function.Supplier; import java.util.function.UnaryOperator; -import javax.annotation.processing.Generated; - -import pro.fessional.wings.tiny.task.database.autogen.tables.interfaces.IWinTaskResult; - /** * The table wings.win_task_result. @@ -33,6 +32,7 @@ public class WinTaskResult implements IWinTaskResult { private Long id; private Long taskId; + private String taskKey; private String taskApp; private Integer taskPid; private String exitData; @@ -46,6 +46,7 @@ public WinTaskResult() {} public WinTaskResult(IWinTaskResult value) { this.id = value.getId(); this.taskId = value.getTaskId(); + this.taskKey = value.getTaskKey(); this.taskApp = value.getTaskApp(); this.taskPid = value.getTaskPid(); this.exitData = value.getExitData(); @@ -58,6 +59,7 @@ public WinTaskResult(IWinTaskResult value) { public WinTaskResult( Long id, Long taskId, + String taskKey, String taskApp, Integer taskPid, String exitData, @@ -68,6 +70,7 @@ public WinTaskResult( ) { this.id = id; this.taskId = taskId; + this.taskKey = taskKey; this.taskApp = taskApp; this.taskPid = taskPid; this.exitData = exitData; @@ -237,6 +240,86 @@ public void setTaskIdIf(UnaryOperator taskId) { } + /** + * Getter for win_task_result.task_key. + */ + @Override + public String getTaskKey() { + return this.taskKey; + } + + /** + * Setter for win_task_result.task_key. + */ + @Override + public void setTaskKey(String taskKey) { + this.taskKey = taskKey; + } + + @Transient + public void setTaskKeyIf(String taskKey, boolean bool) { + if (bool) { + this.taskKey = taskKey; + } + } + + @Transient + public void setTaskKeyIf(Supplier taskKey, boolean bool) { + if (bool) { + this.taskKey = taskKey.get(); + } + } + + @Transient + public void setTaskKeyIf(String taskKey, Predicate bool) { + if (bool.test(taskKey)) { + this.taskKey = taskKey; + } + } + + @Transient + public void setTaskKeyIf(String taskKey, Predicate bool, Supplier... taskKeys) { + if (bool.test(taskKey)) { + this.taskKey = taskKey; + return; + } + for (Supplier supplier : taskKeys) { + taskKey = supplier.get(); + if (bool.test(taskKey)) { + this.taskKey = taskKey; + return; + } + } + } + + @Transient + public void setTaskKeyIfNot(String taskKey, Predicate bool) { + if (!bool.test(taskKey)) { + this.taskKey = taskKey; + } + } + + @Transient + public void setTaskKeyIfNot(String taskKey, Predicate bool, Supplier... taskKeys) { + if (!bool.test(taskKey)) { + this.taskKey = taskKey; + return; + } + for (Supplier supplier : taskKeys) { + taskKey = supplier.get(); + if (!bool.test(taskKey)) { + this.taskKey = taskKey; + return; + } + } + } + + @Transient + public void setTaskKeyIf(UnaryOperator taskKey) { + this.taskKey = taskKey.apply(this.taskKey); + } + + /** * Getter for win_task_result.task_app. */ @@ -818,6 +901,12 @@ else if (!this.id.equals(other.id)) } else if (!this.taskId.equals(other.taskId)) return false; + if (this.taskKey == null) { + if (other.taskKey != null) + return false; + } + else if (!this.taskKey.equals(other.taskKey)) + return false; if (this.taskApp == null) { if (other.taskApp != null) return false; @@ -869,6 +958,7 @@ public int hashCode() { int result = 1; result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); result = prime * result + ((this.taskId == null) ? 0 : this.taskId.hashCode()); + result = prime * result + ((this.taskKey == null) ? 0 : this.taskKey.hashCode()); result = prime * result + ((this.taskApp == null) ? 0 : this.taskApp.hashCode()); result = prime * result + ((this.taskPid == null) ? 0 : this.taskPid.hashCode()); result = prime * result + ((this.exitData == null) ? 0 : this.exitData.hashCode()); @@ -885,6 +975,7 @@ public String toString() { sb.append(id); sb.append(", ").append(taskId); + sb.append(", ").append(taskKey); sb.append(", ").append(taskApp); sb.append(", ").append(taskPid); sb.append(", ").append(exitData); @@ -905,6 +996,7 @@ public String toString() { public void from(IWinTaskResult from) { setId(from.getId()); setTaskId(from.getTaskId()); + setTaskKey(from.getTaskKey()); setTaskApp(from.getTaskApp()); setTaskPid(from.getTaskPid()); setExitData(from.getExitData()); diff --git a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/records/WinTaskResultRecord.java b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/records/WinTaskResultRecord.java index 7f502ba30..a70572e14 100644 --- a/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/records/WinTaskResultRecord.java +++ b/radiant/tiny-task/src/main/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/records/WinTaskResultRecord.java @@ -4,20 +4,18 @@ package pro.fessional.wings.tiny.task.database.autogen.tables.records; -import java.time.LocalDateTime; - -import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record9; -import org.jooq.Row9; +import org.jooq.Record10; +import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; - import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskResultTable; import pro.fessional.wings.tiny.task.database.autogen.tables.interfaces.IWinTaskResult; import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskResult; +import javax.annotation.processing.Generated; +import java.time.LocalDateTime; + /** * The table wings.win_task_result. @@ -31,7 +29,7 @@ comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class WinTaskResultRecord extends UpdatableRecordImpl implements Record9, IWinTaskResult { +public class WinTaskResultRecord extends UpdatableRecordImpl implements Record10, IWinTaskResult { private static final long serialVersionUID = 1L; @@ -67,12 +65,28 @@ public Long getTaskId() { return (Long) get(1); } + /** + * Setter for win_task_result.task_key. + */ + @Override + public void setTaskKey(String value) { + set(2, value); + } + + /** + * Getter for win_task_result.task_key. + */ + @Override + public String getTaskKey() { + return (String) get(2); + } + /** * Setter for win_task_result.task_app. */ @Override public void setTaskApp(String value) { - set(2, value); + set(3, value); } /** @@ -80,7 +94,7 @@ public void setTaskApp(String value) { */ @Override public String getTaskApp() { - return (String) get(2); + return (String) get(3); } /** @@ -88,7 +102,7 @@ public String getTaskApp() { */ @Override public void setTaskPid(Integer value) { - set(3, value); + set(4, value); } /** @@ -96,7 +110,7 @@ public void setTaskPid(Integer value) { */ @Override public Integer getTaskPid() { - return (Integer) get(3); + return (Integer) get(4); } /** @@ -104,7 +118,7 @@ public Integer getTaskPid() { */ @Override public void setExitData(String value) { - set(4, value); + set(5, value); } /** @@ -112,7 +126,7 @@ public void setExitData(String value) { */ @Override public String getExitData() { - return (String) get(4); + return (String) get(5); } /** @@ -120,7 +134,7 @@ public String getExitData() { */ @Override public void setExitFail(Boolean value) { - set(5, value); + set(6, value); } /** @@ -128,7 +142,7 @@ public void setExitFail(Boolean value) { */ @Override public Boolean getExitFail() { - return (Boolean) get(5); + return (Boolean) get(6); } /** @@ -136,7 +150,7 @@ public Boolean getExitFail() { */ @Override public void setTimeExec(LocalDateTime value) { - set(6, value); + set(7, value); } /** @@ -144,7 +158,7 @@ public void setTimeExec(LocalDateTime value) { */ @Override public LocalDateTime getTimeExec() { - return (LocalDateTime) get(6); + return (LocalDateTime) get(7); } /** @@ -152,7 +166,7 @@ public LocalDateTime getTimeExec() { */ @Override public void setTimeExit(LocalDateTime value) { - set(7, value); + set(8, value); } /** @@ -160,7 +174,7 @@ public void setTimeExit(LocalDateTime value) { */ @Override public LocalDateTime getTimeExit() { - return (LocalDateTime) get(7); + return (LocalDateTime) get(8); } /** @@ -168,7 +182,7 @@ public LocalDateTime getTimeExit() { */ @Override public void setTimeCost(Integer value) { - set(8, value); + set(9, value); } /** @@ -176,7 +190,7 @@ public void setTimeCost(Integer value) { */ @Override public Integer getTimeCost() { - return (Integer) get(8); + return (Integer) get(9); } // ------------------------------------------------------------------------- @@ -189,17 +203,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record9 type implementation + // Record10 type implementation // ------------------------------------------------------------------------- @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); } @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); + public Row10 valuesRow() { + return (Row10) super.valuesRow(); } @Override @@ -214,36 +228,41 @@ public Field field2() { @Override public Field field3() { + return WinTaskResultTable.WinTaskResult.TaskKey; + } + + @Override + public Field field4() { return WinTaskResultTable.WinTaskResult.TaskApp; } @Override - public Field field4() { + public Field field5() { return WinTaskResultTable.WinTaskResult.TaskPid; } @Override - public Field field5() { + public Field field6() { return WinTaskResultTable.WinTaskResult.ExitData; } @Override - public Field field6() { + public Field field7() { return WinTaskResultTable.WinTaskResult.ExitFail; } @Override - public Field field7() { + public Field field8() { return WinTaskResultTable.WinTaskResult.TimeExec; } @Override - public Field field8() { + public Field field9() { return WinTaskResultTable.WinTaskResult.TimeExit; } @Override - public Field field9() { + public Field field10() { return WinTaskResultTable.WinTaskResult.TimeCost; } @@ -259,36 +278,41 @@ public Long component2() { @Override public String component3() { + return getTaskKey(); + } + + @Override + public String component4() { return getTaskApp(); } @Override - public Integer component4() { + public Integer component5() { return getTaskPid(); } @Override - public String component5() { + public String component6() { return getExitData(); } @Override - public Boolean component6() { + public Boolean component7() { return getExitFail(); } @Override - public LocalDateTime component7() { + public LocalDateTime component8() { return getTimeExec(); } @Override - public LocalDateTime component8() { + public LocalDateTime component9() { return getTimeExit(); } @Override - public Integer component9() { + public Integer component10() { return getTimeCost(); } @@ -304,36 +328,41 @@ public Long value2() { @Override public String value3() { + return getTaskKey(); + } + + @Override + public String value4() { return getTaskApp(); } @Override - public Integer value4() { + public Integer value5() { return getTaskPid(); } @Override - public String value5() { + public String value6() { return getExitData(); } @Override - public Boolean value6() { + public Boolean value7() { return getExitFail(); } @Override - public LocalDateTime value7() { + public LocalDateTime value8() { return getTimeExec(); } @Override - public LocalDateTime value8() { + public LocalDateTime value9() { return getTimeExit(); } @Override - public Integer value9() { + public Integer value10() { return getTimeCost(); } @@ -351,48 +380,54 @@ public WinTaskResultRecord value2(Long value) { @Override public WinTaskResultRecord value3(String value) { + setTaskKey(value); + return this; + } + + @Override + public WinTaskResultRecord value4(String value) { setTaskApp(value); return this; } @Override - public WinTaskResultRecord value4(Integer value) { + public WinTaskResultRecord value5(Integer value) { setTaskPid(value); return this; } @Override - public WinTaskResultRecord value5(String value) { + public WinTaskResultRecord value6(String value) { setExitData(value); return this; } @Override - public WinTaskResultRecord value6(Boolean value) { + public WinTaskResultRecord value7(Boolean value) { setExitFail(value); return this; } @Override - public WinTaskResultRecord value7(LocalDateTime value) { + public WinTaskResultRecord value8(LocalDateTime value) { setTimeExec(value); return this; } @Override - public WinTaskResultRecord value8(LocalDateTime value) { + public WinTaskResultRecord value9(LocalDateTime value) { setTimeExit(value); return this; } @Override - public WinTaskResultRecord value9(Integer value) { + public WinTaskResultRecord value10(Integer value) { setTimeCost(value); return this; } @Override - public WinTaskResultRecord values(Long value1, Long value2, String value3, Integer value4, String value5, Boolean value6, LocalDateTime value7, LocalDateTime value8, Integer value9) { + public WinTaskResultRecord values(Long value1, Long value2, String value3, String value4, Integer value5, String value6, Boolean value7, LocalDateTime value8, LocalDateTime value9, Integer value10) { value1(value1); value2(value2); value3(value3); @@ -402,6 +437,7 @@ public WinTaskResultRecord values(Long value1, Long value2, String value3, Integ value7(value7); value8(value8); value9(value9); + value10(value10); return this; } @@ -413,6 +449,7 @@ public WinTaskResultRecord values(Long value1, Long value2, String value3, Integ public void from(IWinTaskResult from) { setId(from.getId()); setTaskId(from.getTaskId()); + setTaskKey(from.getTaskKey()); setTaskApp(from.getTaskApp()); setTaskPid(from.getTaskPid()); setExitData(from.getExitData()); @@ -443,11 +480,12 @@ public WinTaskResultRecord() { /** * Create a detached, initialised WinTaskResultRecord */ - public WinTaskResultRecord(Long id, Long taskId, String taskApp, Integer taskPid, String exitData, Boolean exitFail, LocalDateTime timeExec, LocalDateTime timeExit, Integer timeCost) { + public WinTaskResultRecord(Long id, Long taskId, String taskKey, String taskApp, Integer taskPid, String exitData, Boolean exitFail, LocalDateTime timeExec, LocalDateTime timeExit, Integer timeCost) { super(WinTaskResultTable.WinTaskResult); setId(id); setTaskId(taskId); + setTaskKey(taskKey); setTaskApp(taskApp); setTaskPid(taskPid); setExitData(exitData); @@ -467,6 +505,7 @@ public WinTaskResultRecord(WinTaskResult value) { if (value != null) { setId(value.getId()); setTaskId(value.getTaskId()); + setTaskKey(value.getTaskKey()); setTaskApp(value.getTaskApp()); setTaskPid(value.getTaskPid()); setExitData(value.getExitData()); diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/schedule/exec/ExecHolder.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/schedule/exec/ExecHolder.java index eede2aac0..5fb158387 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/schedule/exec/ExecHolder.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/schedule/exec/ExecHolder.java @@ -17,29 +17,29 @@ public class ExecHolder { private static final ConcurrentHashMap Tasker = new ConcurrentHashMap<>(); @NotNull - public static NoticeExec getNotice(@NotNull String token, @NotNull Function> exec) { - return Notice.computeIfAbsent(token, exec); - } - - @NotNull - public static TaskerExec getTasker(@NotNull String token, @NotNull Function exec) { - return Tasker.computeIfAbsent(token, exec); + public static NoticeExec getNotice(@NotNull String bean, @NotNull Function> exec) { + return Notice.computeIfAbsent(bean, exec); } @Contract("_,true->!null") - public static NoticeExec getNotice(String token, boolean nonnull) { - final NoticeExec exec = StringUtils.isEmpty(token) ? null : Notice.get(token); + public static NoticeExec getNotice(String bean, boolean nonnull) { + final NoticeExec exec = StringUtils.isEmpty(bean) ? null : Notice.get(bean); if (nonnull && exec == null) { - throw new IllegalStateException("notice not found, token=" + token); + throw new IllegalStateException("notice not found, bean=" + bean); } return exec; } + @NotNull + public static TaskerExec getTasker(@NotNull String prop, @NotNull Function exec) { + return Tasker.computeIfAbsent(prop, exec); + } + @Contract("_,true->!null") - public static TaskerExec getTasker(String token, boolean nonnull) { - final TaskerExec exec = StringUtils.isEmpty(token) ? null : Tasker.get(token); + public static TaskerExec getTasker(String prop, boolean nonnull) { + final TaskerExec exec = StringUtils.isEmpty(prop) ? null : Tasker.get(prop); if (nonnull && exec == null) { - throw new IllegalStateException("tasker not found, token=" + token); + throw new IllegalStateException("tasker not found, prop=" + prop); } return exec; } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskConfService.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskConfService.java index 27d88b2a6..0be41b3b8 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskConfService.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskConfService.java @@ -69,6 +69,7 @@ public interface TinyTaskConfService { @Data class Conf { private final long id; + private final String key; private final boolean enabled; private final boolean autorun; } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskService.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskService.java index 60db98ef4..e4974533f 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskService.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/TinyTaskService.java @@ -112,6 +112,7 @@ default Task schedule(@NotNull Lam.Ref lambdaRefer, @Nullable Object taskerPara) @Data class Task { private final long id; + private final String key; private final boolean scheduled; } } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java index a2b913889..2e96ac80e 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java @@ -10,7 +10,6 @@ import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.support.CronExpression; -import org.springframework.stereotype.Service; import pro.fessional.mirana.time.DateLocaling; import pro.fessional.mirana.time.ThreadNow; import pro.fessional.wings.faceless.convention.EmptySugar; @@ -35,7 +34,6 @@ * @author trydofor * @since 2022-12-26 */ -@Service @ConditionalWingsEnabled @TinyTasker.Auto @Slf4j diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java index 477f79d25..3aec8e18d 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java @@ -178,7 +178,7 @@ public TaskerProp property(long id, boolean nonnull) { } } - final TinyTasker anno = referAnno(r2.value2()); + final TinyTasker anno = referAnno(r2.value1(), r2.value2()); AssertArgs.notNull(anno, "database without TinyTasker, id={}", id); return property(r2.value1(), anno); @@ -190,16 +190,16 @@ public LinkedHashMap> diffProp(long id) { final WinTaskDefine po = fetchProp(WinTaskDefine.class, t -> t.Id.eq(id)); AssertArgs.notNull(po, "database tasker is null, id={}", id); - final TinyTasker anno = referAnno(po.getTaskerBean()); + final TinyTasker anno = referAnno(po.getPropkey(), po.getTaskerBean()); AssertArgs.notNull(anno, "database without TinyTasker, id={}", id); final TaskerProp prop = property(po.getPropkey(), anno); return diff(po, prop); } - private TinyTasker referAnno(String token) { - final TaskerExec tk = ExecHolder.getTasker(token, false); - final Method md = tk != null ? tk.getBeanMethod() : TaskerHelper.referMethod(token); + private TinyTasker referAnno(String key, String entry) { + final TaskerExec tk = ExecHolder.getTasker(key, false); + final Method md = tk != null ? tk.getBeanMethod() : TaskerHelper.referMethod(entry); return md.getAnnotation(TinyTasker.class); } @@ -231,39 +231,39 @@ private Conf config(@NotNull Class claz, @NotNull Object bean, @NotNull Metho if (anno == null) { throw new IllegalStateException("need @TinyTasker, tasker method=" + method.getName() + ", class=" + claz.getName()); } - String key = anno.value(); - if (isEmpty(key)) { - key = TaskerHelper.tokenize(claz, method.getName()); - } + + final String entry = TaskerHelper.tokenize(claz, method.getName()); + final String key = isEmpty(anno.value()) ? entry : anno.value(); final TaskerProp prop = property(key, anno); if (prop.notTimingCron() && prop.notTimingIdle() && prop.notTimingRate()) { throw new IllegalStateException( "need cron/idle/rate ,method=" + method.getName() - + ", class=" + claz.getName() + " ,prop=" + key + + ", class=" + claz.getName() + ", prop=" + key ); } - String tkn = TaskerHelper.tokenize(claz, method.getName()); - log.debug("find tiny task, prop={}, ref={}", key, tkn); + log.info("find tiny task, prop={}, entry={}", key, entry); if (isEmpty(prop.getTaskerName())) { prop.setTaskerName(claz.getSimpleName() + TaskerHelper.MethodPrefix + method.getName()); } - final TaskerExec tasker = ExecHolder.getTasker(tkn, k -> new TaskerExec(claz, bean, method)); + final TaskerExec tasker = ExecHolder.getTasker(key, k -> new TaskerExec(claz, bean, method)); if (!method.equals(tasker.getBeanMethod())) { - throw new IllegalStateException("diff method with same token=" + tkn); + throw new IllegalStateException("diff method with same prop=" + key + + ", entry1=" + claz.getName() + "#" + method.getName() + + ", entry2=" + tasker.getBeanClass().getName() + "#" + tasker.getBeanMethod().getName()); } - prop.setTaskerBean(tkn); + prop.setTaskerBean(entry); prop.setTaskerPara(tasker.encodePara(para)); final long id; final boolean enabled; final boolean autorun; final String noticeBean; - final WinTaskDefine po = fetchProp(WinTaskDefine.class, t -> t.TaskerBean.eq(tkn)); + final WinTaskDefine po = fetchProp(WinTaskDefine.class, t -> t.TaskerBean.eq(entry)); if (po == null) { id = insertProp(prop, key); enabled = prop.isEnabled(); @@ -290,14 +290,22 @@ private Conf config(@NotNull Class claz, @NotNull Object bean, @NotNull Metho } if (po.getVersion() <= prop.getVersion()) { updateProp(prop, key, id); - log.info("update prop to database, taks={}, diff={}", key, sb); + log.info("update prop to database, prop={}, diff={}", key, sb); } else { - log.warn("diff from prop and database, task={}, diff={}", key, sb); + log.warn("diff from prop and database, prop={}, diff={}", key, sb); } } } + // check dulpli key + final WinTaskDefine poKey = fetchProp(WinTaskDefine.class, t -> t.Propkey.eq(key)); + if (poKey != null && !entry.equals(poKey.getTaskerBean())) { + throw new IllegalStateException("diff TaskerBean with same prop=" + key + + ", entry1=" + entry + + ", entry2=" + poKey.getTaskerBean()); + } + if (noticeBean != null && !noticeBean.isEmpty()) { ExecHolder.getNotice(noticeBean, k -> { try { @@ -312,7 +320,7 @@ private Conf config(@NotNull Class claz, @NotNull Object bean, @NotNull Metho }); } - return new Conf(id, enabled, autorun); + return new Conf(id, key, enabled, autorun); } private long insertProp(TaskerProp prop, String key) { diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java index 60cd40007..8168df3f4 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java @@ -115,19 +115,19 @@ public boolean force(long id) { long execTms = ThreadNow.millis(); long doneTms = -1; long failTms = -1; - final String taskerName = td.getTaskerName() + " force"; + final String taskerInfo = td.getPropkey() + " force"; final String noticeConf = td.getNoticeConf(); String taskMsg = "force task id=" + id; NoticeExec notice = null; Set ntcWhen = Collections.emptySet(); try { - final TaskerExec tasker = ExecHolder.getTasker(td.getTaskerBean(), true); + final TaskerExec tasker = ExecHolder.getTasker(td.getPropkey(), true); notice = ExecHolder.getNotice(td.getNoticeBean(), false); if (notice != null) ntcWhen = noticeWhen(td.getNoticeWhen()); - postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, execTms, WhenExec); + postNotice(notice, noticeConf, ntcWhen, taskerInfo, taskMsg, execTms, WhenExec); log.debug("task force exec, id={}", id); final Object result; @@ -143,17 +143,17 @@ public boolean force(long id) { // doneTms = ThreadNow.millis(); taskMsg = stringResult(result); - postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, doneTms, WhenFeed, WhenDone); + postNotice(notice, noticeConf, ntcWhen, taskerInfo, taskMsg, doneTms, WhenFeed, WhenDone); } catch (Exception e) { log.error("task force fail, id=" + id, e); failTms = ThreadNow.millis(); taskMsg = ThrowableUtil.toString(e); - postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, failTms, WhenFail); + postNotice(notice, noticeConf, ntcWhen, taskerInfo, taskMsg, failTms, WhenFail); } finally { try { - saveResult(id, execTms, failTms, doneTms, taskMsg, td.getDurFail()); + saveResult(id, td.getPropkey(), execTms, failTms, doneTms, taskMsg, td.getDurFail()); } catch (Exception e) { log.error("failed to save result, id=" + id, e); @@ -216,20 +216,21 @@ private boolean relaunch(long id) { // temp save before schedule to avoid kill saveNextExec(next, td); + final String key = td.getPropkey(); final boolean fast = BoxedCastUtil.orTrue(td.getTaskerFast()); final var taskScheduler = fast ? TaskSchedulerHelper.Fast() : TaskSchedulerHelper.Scheduled(); if (taskScheduler.getScheduledExecutor().isShutdown()) { - log.error("TaskScheduler={} is shutdown, id={}, name={}", fast, id, td.getTaskerName()); + log.error("TaskScheduler={} is shutdown, id={}, prop={}", fast, id, key); return false; } - log.info("prepare task id={}, name={}", id, td.getTaskerName()); + log.info("prepare task id={}, prop={}", id, key); final ScheduledFuture handle = taskScheduler.schedule(() -> { long execTms = ThreadNow.millis(); try { if (notNextLock(td, execTms)) { - log.warn("skip task for Not nextLock, should manually check and launch it, id={}, name={}", id, td.getTaskerName()); + log.warn("skip task for Not nextLock, should manually check and launch it, id={}, prop={}", id, key); Handle.remove(id); return; } @@ -242,49 +243,50 @@ private boolean relaunch(long id) { long doneTms = -1; long failTms = -1; - final String taskerName = td.getTaskerName(); + final String taskerInfo = key + " launch"; final String noticeConf = td.getNoticeConf(); - String taskMsg = "relaunch task id=" + id; + String exitMsg = "relaunch task id=" + id; NoticeExec notice = null; Set ntcWhen = Collections.emptySet(); try { - final TaskerExec tasker = ExecHolder.getTasker(td.getTaskerBean(), true); + final TaskerExec tasker = ExecHolder.getTasker(key, true); notice = ExecHolder.getNotice(td.getNoticeBean(), false); if (notice != null) ntcWhen = noticeWhen(td.getNoticeWhen()); - postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, execTms, WhenExec); - log.info("task exec, id={}, name={}", id, td.getTaskerName()); + postNotice(notice, noticeConf, ntcWhen, taskerInfo, exitMsg, execTms, WhenExec); + log.info("task exec, id={}, prop={}", id, key); final Object result; if (execProp.isDryrun()) { final long slp = Sleep.ignoreInterrupt(10, 2000); result = "dryrun and sleep " + slp; - log.info("task done, dryrun and sleep {} ms, id={}, name={}", slp, id, td.getTaskerName()); + log.info("task done, dryrun and sleep {} ms, id={}, prop={}", slp, id, key); } else { result = tasker.invoke(td.getTaskerPara(), true); - log.info("task done, id={}, name={}", id, td.getTaskerName()); + log.info("task done, id={}, prop={}", id, key); } // doneTms = ThreadNow.millis(); - taskMsg = stringResult(result); - postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, doneTms, WhenFeed, WhenDone); + exitMsg = stringResult(result); + postNotice(notice, noticeConf, ntcWhen, taskerInfo, exitMsg, doneTms, WhenFeed, WhenDone); } catch (Exception e) { - log.error("task fail, id=" + id + "name=" + td.getTaskerName(), e); + Throwable c = ThrowableUtil.cause(e, 1); + log.error("task fail, id=" + id + ", prop=" + key, c); failTms = ThreadNow.millis(); - taskMsg = ThrowableUtil.toString(e); - postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, failTms, WhenFail); + exitMsg = ThrowableUtil.toString(c); + postNotice(notice, noticeConf, ntcWhen, taskerInfo, exitMsg, failTms, WhenFail); } finally { try { Handle.remove(id); - saveResult(id, execTms, failTms, doneTms, taskMsg, td.getDurFail()); + saveResult(id, key, execTms, failTms, doneTms, exitMsg, td.getDurFail()); } catch (Exception e) { - log.error("failed to save result, id=" + id + "name=" + td.getTaskerName(), e); + log.error("failed to save result, id=" + id + ", prop=" + key, e); } if (canRelaunch(id, doneTms, failTms, td)) { // canceled @@ -351,19 +353,19 @@ private String stringResult(Object result) { return JacksonHelper.string(result); } - private void postNotice(NoticeExec ntc, String cnf, Set whs, String tn, String msg, long ms, String... wh) { + private void postNotice(NoticeExec ntc, String cnf, Set whs, String sub, String msg, long ms, String... wh) { if (ntc == null) return; final String zdt = ZonedDateTime.ofInstant(Instant.ofEpochMilli(ms), ThreadNow.sysZoneId()).toString(); for (String w : wh) { if (whs.contains(w)) { if (w.equals(WhenFeed)) { if (!execProp.isDryrun() && StringUtils.isNotEmpty(msg)) { - ntc.postNotice(cnf, tn + " " + w.toUpperCase(), zdt + "\n\n" + msg); + ntc.postNotice(cnf, sub + " " + w.toUpperCase(), zdt + "\n\n" + msg); return; } } else { - ntc.postNotice(cnf, tn + " " + w.toUpperCase(), msg == null ? zdt : zdt + "\n\n" + msg); + ntc.postNotice(cnf, sub + " " + w.toUpperCase(), msg == null ? zdt : zdt + "\n\n" + msg); return; } } @@ -396,7 +398,7 @@ private void saveNextExec(long next, WinTaskDefine td) { ); } - private void saveResult(Long id, long exec, long fail, long done, String msg, int cf) { + private void saveResult(long id, String key, long exec, long fail, long done, String msg, int cf) { log.debug("saveResult, id={}", id); final WinTaskDefineTable td = winTaskDefineDao.getTable(); Map, Object> setter = new HashMap<>(); @@ -428,6 +430,7 @@ private void saveResult(Long id, long exec, long fail, long done, String msg, in final WinTaskResult po = new WinTaskResult(); po.setId(lightIdService.getId(winTaskResultDao.getTable())); po.setTaskId(id); + po.setTaskKey(key); po.setTaskApp(appName); po.setTaskPid(JvmStat.jvmPid()); po.setExitData(msg); diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java index 0cb3df2ca..e34f82d7d 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java @@ -48,7 +48,7 @@ public Set schedule(@NotNull Object taskerBean) { if (cnf.isEnabled() && cnf.isAutorun()) { final boolean cd = tinyTaskExecService.launch(cnf.getId()); log.info("schedule task {}, scheduled={}", cnf, cd); - rst.add(new Task(cnf.getId(), cd)); + rst.add(new Task(cnf.getId(), cnf.getKey(), cd)); } else { log.info("skip task {}", cnf); @@ -70,6 +70,6 @@ public Task schedule(@NotNull Object taskerBean, @NotNull Method taskerCall, @Nu log.info("skip task {}", cnf); } - return new Task(cnf.getId(), cd); + return new Task(cnf.getId(), cnf.getKey(), cd); } } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java index d3cdfff0c..89ee184ed 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java @@ -17,9 +17,12 @@ import pro.fessional.wings.tiny.task.database.TinyTaskDatabase; import pro.fessional.wings.tiny.task.schedule.TinyTasker; import pro.fessional.wings.tiny.task.service.TinyTaskService; +import pro.fessional.wings.tiny.task.service.TinyTaskService.Task; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * @author trydofor @@ -66,8 +69,9 @@ public ApplicationReadyEventRunner tinyTaskerAutoRunner(@NotNull ApplicationCont final Map beans = context.getBeansWithAnnotation(TinyTasker.Auto.class); for (Map.Entry en : beans.entrySet()) { - log.info("TinyTask spring-conf TinyTaskerAuto, name=" + en.getKey()); - service.schedule(en.getValue()); + Set tasks = service.schedule(en.getValue()); + log.info("TinyTask spring-conf TinyTaskerAuto, bean=" + en.getKey() + ", props=" + + tasks.stream().map(Task::getKey).collect(Collectors.joining(","))); } }); } diff --git a/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26u02-task-tune.sql b/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26u02-task-tune.sql index 284f673ec..b2eec67fa 100644 --- a/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26u02-task-tune.sql +++ b/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26u02-task-tune.sql @@ -17,6 +17,7 @@ ALTER TABLE `win_task_define` -- win_task_result ALTER TABLE `win_task_result` + DROP COLUMN `task_key`, CHANGE COLUMN `exit_data` `task_msg` TEXT NULL DEFAULT NULL COMMENT 'Normal or abnormal messages', ADD COLUMN `time_fail` DATETIME(3) NOT NULL DEFAULT '1000-01-01' COMMENT 'datetime of fail (sys)' AFTER `time_exec`, CHANGE COLUMN `time_exit` `time_done` DATETIME(3) NOT NULL DEFAULT '1000-01-01' COMMENT 'datetime of done (sys)'; diff --git a/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26v02-task-tune.sql b/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26v02-task-tune.sql index c60385147..8b0d17c74 100644 --- a/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26v02-task-tune.sql +++ b/radiant/tiny-task/src/main/resources/wings-flywave/branch/somefix/03-v32-130/2021-10-26v02-task-tune.sql @@ -19,10 +19,15 @@ WHERE timing_tune = 1; -- win_task_result ALTER TABLE `win_task_result` + ADD COLUMN `task_key` VARCHAR(200) NOT NULL DEFAULT '' COMMENT 'conf file key, auto-generated' AFTER `task_id`, CHANGE COLUMN `task_msg` `exit_data` TEXT NULL DEFAULT NULL COMMENT 'return (json) or exception (stacktrace)', ADD COLUMN `exit_fail` TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'whether fail' AFTER `exit_data`, CHANGE COLUMN `time_done` `time_exit` DATETIME(3) NOT NULL DEFAULT '1000-01-01' COMMENT 'datetime of done/fail (sys)'; +UPDATE `win_task_result` +SET task_key = (select propkey from win_task_define WHERE id = task_id) +WHERE task_key = ''; + UPDATE `win_task_result` SET time_exit = time_fail, exit_fail = 1 diff --git a/radiant/tiny-task/src/main/resources/wings-flywave/master/06-task/2020-10-26v01-tiny_task.sql b/radiant/tiny-task/src/main/resources/wings-flywave/master/06-task/2020-10-26v01-tiny_task.sql index 3b7bb945f..06e0dce68 100644 --- a/radiant/tiny-task/src/main/resources/wings-flywave/master/06-task/2020-10-26v01-tiny_task.sql +++ b/radiant/tiny-task/src/main/resources/wings-flywave/master/06-task/2020-10-26v01-tiny_task.sql @@ -49,6 +49,7 @@ CREATE TABLE `win_task_define` ( CREATE TABLE `win_task_result` ( `id` BIGINT(20) NOT NULL COMMENT 'primary key', `task_id` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'task id, win_task_define.id', + `task_key` VARCHAR(200) NOT NULL DEFAULT '' COMMENT 'conf file key, auto-generated', `task_app` VARCHAR(300) NOT NULL DEFAULT '' COMMENT 'belong to applications, comma-separated', `task_pid` INT(11) NOT NULL DEFAULT '0' COMMENT 'belong to jvm pid', `exit_data` TEXT NULL DEFAULT NULL COMMENT 'return (json) or exception (stacktrace)',