mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
revert: temporary remove @Type(StringType) due to it will change the db colum type to varchar
This commit is contained in:
parent
12162f2955
commit
2d989d2b0b
@ -6,7 +6,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 执行服务器运行
|
||||
* 需要在指定的服务器运行
|
||||
* 注意:该注解所在方法的参数必须为对象,不可以是 long 等基本类型
|
||||
*
|
||||
* @author tjq
|
||||
|
@ -62,7 +62,7 @@ public class DesignateServerAspect {
|
||||
}
|
||||
|
||||
if (appId == null) {
|
||||
throw new PowerJobException("can't find appId in params!");
|
||||
throw new PowerJobException("can't find appId in params for:" + signature.toString());
|
||||
}
|
||||
|
||||
// 获取执行机器
|
||||
|
@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
@ -37,7 +36,6 @@ public class InstanceInfoDO {
|
||||
// 任务实例参数
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String instanceParams;
|
||||
|
||||
// 该任务实例的类型,普通/工作流(InstanceType)
|
||||
@ -51,7 +49,6 @@ public class InstanceInfoDO {
|
||||
// 执行结果(允许存储稍大的结果)
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String result;
|
||||
// 预计触发时间
|
||||
private Long expectedTriggerTime;
|
||||
|
@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
@ -53,7 +52,6 @@ public class JobInfoDO {
|
||||
// 执行器信息(可能需要存储整个脚本文件)
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String processorInfo;
|
||||
|
||||
/* ************************** 运行时配置 ************************** */
|
||||
|
@ -1,9 +0,0 @@
|
||||
package com.github.kfcfans.powerjob.server.persistence.core.model;
|
||||
|
||||
/**
|
||||
* @see package-info.java
|
||||
* @author user
|
||||
*/
|
||||
public final class TypeDefConstant {
|
||||
public static final String STRING_TYPE = "string-type";
|
||||
}
|
@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
@ -36,7 +35,6 @@ public class WorkflowInfoDO {
|
||||
// 工作流的DAG图信息(点线式DAG的json)
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String peDAG;
|
||||
|
||||
/* ************************** 定时参数 ************************** */
|
||||
|
@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
@ -40,16 +39,13 @@ public class WorkflowInstanceInfoDO {
|
||||
// 工作流启动参数
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String wfInitParams;
|
||||
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String dag;
|
||||
@Lob
|
||||
@Column
|
||||
@Type(type = TypeDefConstant.STRING_TYPE)
|
||||
private String result;
|
||||
|
||||
// 预计触发时间
|
||||
|
@ -1,7 +0,0 @@
|
||||
@TypeDefs({
|
||||
@TypeDef(name = TypeDefConstant.STRING_TYPE, typeClass = org.hibernate.type.StringType.class)
|
||||
})
|
||||
package com.github.kfcfans.powerjob.server.persistence.core.model;
|
||||
|
||||
import org.hibernate.annotations.TypeDef;
|
||||
import org.hibernate.annotations.TypeDefs;
|
@ -81,7 +81,7 @@ public class DispatchService {
|
||||
if (maxInstanceNum > 0) {
|
||||
|
||||
// 这个 runningInstanceCount 已经包含了本 instance
|
||||
// 不统计 WAITING_DISPATCH 的状态:使用 OpenAPI 触发的延迟任务显然不应该统计进去(比如 delay 是 1 天)
|
||||
// 不统计 WAITING_DISPATCH 的状态:使用 OpenAPI 触发的延迟任务不应该统计进去(比如 delay 是 1 天)
|
||||
long runningInstanceCount = instanceInfoRepository.countByJobIdAndStatusIn(jobId, Lists.newArrayList(WAITING_WORKER_RECEIVE.getV(), RUNNING.getV()));
|
||||
// 超出最大同时运行限制,不执行调度
|
||||
if (runningInstanceCount > maxInstanceNum) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user