Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package prerna.engine.impl.guardrail;

import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.locks.ReentrantLock;

Expand Down Expand Up @@ -176,4 +177,23 @@ protected void startServer(int port) {
}
}

/**
* Stops the python process this guardrail started, so an instance opened again
* starts its own and runs the current python files. The process's folder is
* kept: it is the engine's {@code py} folder, which the startup script puts on
* the python path for the guardrail's own modules.
*/
@Override
public void close() throws IOException {
super.close();
this.startServerLock.lock();
try {
if (this.cpw != null) {
this.cpw.shutdown(false);
}
} finally {
this.startServerLock.unlock();
}
}

}
Loading