Remove blend files after the render has started
This commit is contained in:
@@ -627,6 +627,8 @@ public class Client {
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
removeSceneDirectory(ajob);
|
||||
|
||||
return Error.Type.OK;
|
||||
}
|
||||
@@ -699,6 +701,10 @@ public class Client {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void removeSceneDirectory(Job ajob) {
|
||||
Utils.delete(new File(ajob.getSceneDirectory()));
|
||||
}
|
||||
|
||||
protected int prepareWorkingDirectory(Job ajob) throws FermeExceptionNoSpaceLeftOnDevice {
|
||||
int ret;
|
||||
|
||||
@@ -70,10 +70,14 @@ public class Job {
|
||||
private boolean serverBlockJob;
|
||||
private Gui gui;
|
||||
private Configuration config;
|
||||
private Client client;
|
||||
private Log log;
|
||||
|
||||
private boolean directoryRemoved;
|
||||
|
||||
public Job(Configuration config_, Gui gui_, Log log_, String id_, String frame_, String path_, boolean use_gpu, String command_, String script_, String sceneMd5_, String rendererMd5_, String name_, String password_, String extras_, boolean synchronous_upload_, String update_method_) {
|
||||
public Job(Configuration config_, Client client_, Gui gui_, Log log_, String id_, String frame_, String path_, boolean use_gpu, String command_, String script_, String sceneMd5_, String rendererMd5_, String name_, String password_, String extras_, boolean synchronous_upload_, String update_method_) {
|
||||
config = config_;
|
||||
client = client_;
|
||||
id = id_;
|
||||
numFrame = frame_;
|
||||
path = path_;
|
||||
@@ -94,6 +98,7 @@ public class Job {
|
||||
serverBlockJob = false;
|
||||
log = log_;
|
||||
render = new RenderProcess();
|
||||
directoryRemoved = false;
|
||||
}
|
||||
|
||||
public void block() {
|
||||
@@ -371,6 +376,11 @@ public class Job {
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
if (directoryRemoved == false && (process.getMemoryUsed() > 0 || process.getRemainingDuration() > 0)) {
|
||||
client.removeSceneDirectory(this);
|
||||
directoryRemoved = true;
|
||||
}
|
||||
}
|
||||
input.close();
|
||||
}
|
||||
|
||||
@@ -464,6 +464,7 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
|
||||
|
||||
Job a_job = new Job(
|
||||
this.user_config,
|
||||
this.client,
|
||||
this.client.getGui(),
|
||||
this.client.getLog(),
|
||||
job_node.getAttribute("id"),
|
||||
|
||||
Reference in New Issue
Block a user