I have a spring MVC application that need to run a python script that uploads a zip to the api. I need to render the page to the user and run the python script in the background so that the zip gets updates while the user can keep on working in the Spring Application.
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
String[] cmd = {
"python",
"/Users/rasheenruwisha/final-year-proj/build.py",
"ARG 1",
"ARG 2",
};
try {
Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
}
});
t1.start();
return modelAndView;
This is the current approach I am using, I am not getting any errors but the script does not get executed, is there anything I'm doing wrong?