mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: the workflow instance whose max instance number is less than or equal to zero is always allowed to be executed
This commit is contained in:
parent
21291b34cb
commit
8f9e53ed83
@ -162,13 +162,15 @@ public class WorkflowInstanceManager {
|
|||||||
log.info("[Workflow-{}|{}] workflowInstance({}) needn't running any more.", wfInfo.getId(), wfInstanceId, wfInstanceInfo);
|
log.info("[Workflow-{}|{}] workflowInstance({}) needn't running any more.", wfInfo.getId(), wfInstanceId, wfInstanceInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 最大实例数量 <= 0 表示不限制
|
||||||
|
if (wfInfo.getMaxWfInstanceNum() > 0) {
|
||||||
// 并发度控制
|
// 并发度控制
|
||||||
int instanceConcurrency = workflowInstanceInfoRepository.countByWorkflowIdAndStatusIn(wfInfo.getId(), WorkflowInstanceStatus.GENERALIZED_RUNNING_STATUS);
|
int instanceConcurrency = workflowInstanceInfoRepository.countByWorkflowIdAndStatusIn(wfInfo.getId(), WorkflowInstanceStatus.GENERALIZED_RUNNING_STATUS);
|
||||||
if (instanceConcurrency > wfInfo.getMaxWfInstanceNum()) {
|
if ( instanceConcurrency > wfInfo.getMaxWfInstanceNum()) {
|
||||||
onWorkflowInstanceFailed(String.format(SystemInstanceResult.TOO_MANY_INSTANCES, instanceConcurrency, wfInfo.getMaxWfInstanceNum()), wfInstanceInfo);
|
onWorkflowInstanceFailed(String.format(SystemInstanceResult.TOO_MANY_INSTANCES, instanceConcurrency, wfInfo.getMaxWfInstanceNum()), wfInstanceInfo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 从实例中读取工作流信息
|
// 从实例中读取工作流信息
|
||||||
|
Loading…
x
Reference in New Issue
Block a user