spring-cloud-deployer-local
spring-cloud-deployer-local copied to clipboard
Tasks does not become RUNNING if they don't expose a http endpoint
Hi,
With current implementation a task become RUNNING status only if the process is running and it has a web container. We have tasks to do one time jobs such as sending email, converting xcel to xml, some json transfers etc.. which they don't have web dependency. They never become RUNNING, instead they become LAUNCHING. My question is how reasonable to expect a task to expose a http endpoint ?
if (exit != null) {
if (exit == 0) {
return LaunchState.complete;
}
else {
return LaunchState.failed;
}
}else{
return LaunchState.running;
}
try {
HttpURLConnection urlConnection = (HttpURLConnection) baseUrl.openConnection();
urlConnection.setConnectTimeout(100);
urlConnection.connect();
urlConnection.disconnect();
return LaunchState.running;
}
catch (IOException e) {
return LaunchState.launching;
}
For tasks then perhaps we just need to ensure there is a process id.....