@ -124,14 +124,12 @@ public class ExecutorService extends BaseService{
return result ;
}
// check master server exists
List < Server > masterServers = monitorService . getServerListFromZK ( true ) ;
if ( masterServers . size ( ) = = 0 ) {
putMsg ( result , Status . MASTER_NOT_EXISTS ) ;
// check master exists
if ( ! checkMasterExists ( result ) ) {
return result ;
}
/ * *
* create command
* /
@ -152,6 +150,22 @@ public class ExecutorService extends BaseService{
return result ;
}
/ * *
* check whether master exists
* @param result result
* @return master exists return true , otherwise return false
* /
private boolean checkMasterExists ( Map < String , Object > result ) {
// check master server exists
List < Server > masterServers = monitorService . getServerListFromZK ( true ) ;
// no master
if ( masterServers . size ( ) = = 0 ) {
putMsg ( result , Status . MASTER_NOT_EXISTS ) ;
return false ;
}
return true ;
}
/ * *
@ -195,6 +209,12 @@ public class ExecutorService extends BaseService{
return checkResult ;
}
// check master exists
if ( ! checkMasterExists ( result ) ) {
return result ;
}
ProcessInstance processInstance = processService . findProcessInstanceDetailById ( processInstanceId ) ;
if ( processInstance = = null ) {
putMsg ( result , Status . PROCESS_INSTANCE_NOT_EXIST , processInstanceId ) ;