Browse Source

bugfix-user-specified queue takes precedence over tenant queue (#769)

Solve the problem that the user queue setting does not take effect
pull/2/head
qrfxiaoge 5 years ago committed by qiaozhanwei
parent
commit
055b071348
  1. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java
  2. 5
      escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java

2
escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java

@ -1739,7 +1739,7 @@ public class ProcessDao extends AbstractBaseDao {
* @param processInstanceId
* @return
*/
public String queryQueueByProcessInstanceId(int processInstanceId){
public String queryUserQueueByProcessInstanceId(int processInstanceId){
return userMapper.queryQueueByProcessInstanceId(processInstanceId);
}

5
escheduler-server/src/main/java/cn/escheduler/server/worker/runner/FetchTaskThread.java

@ -187,8 +187,9 @@ public class FetchTaskThread implements Runnable{
continue;
}
// set queue for process instance
taskInstance.getProcessInstance().setQueue(tenant.getQueue());
// set queue for process instance, user-specified queue takes precedence over tenant queue
String userQueue = processDao.queryUserQueueByProcessInstanceId(taskInstance.getProcessInstanceId());
taskInstance.getProcessInstance().setQueue(StringUtils.isEmpty(userQueue) ? tenant.getQueue() : userQueue);
logger.info("worker fetch taskId : {} from queue ", taskInstId);

Loading…
Cancel
Save