Remove blend files after the render has started

This commit is contained in:
Laurent Clouet
2019-08-07 17:02:52 +02:00
parent edbd4cae52
commit de4dfcd047
3 changed files with 18 additions and 1 deletions

View File

@@ -627,6 +627,8 @@ public class Client {
} }
return err; return err;
} }
removeSceneDirectory(ajob);
return Error.Type.OK; return Error.Type.OK;
} }
@@ -699,6 +701,10 @@ public class Client {
return true; return true;
} }
protected void removeSceneDirectory(Job ajob) {
Utils.delete(new File(ajob.getSceneDirectory()));
}
protected int prepareWorkingDirectory(Job ajob) throws FermeExceptionNoSpaceLeftOnDevice { protected int prepareWorkingDirectory(Job ajob) throws FermeExceptionNoSpaceLeftOnDevice {
int ret; int ret;

View File

@@ -70,10 +70,14 @@ public class Job {
private boolean serverBlockJob; private boolean serverBlockJob;
private Gui gui; private Gui gui;
private Configuration config; private Configuration config;
private Client client;
private Log log; 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_; config = config_;
client = client_;
id = id_; id = id_;
numFrame = frame_; numFrame = frame_;
path = path_; path = path_;
@@ -94,6 +98,7 @@ public class Job {
serverBlockJob = false; serverBlockJob = false;
log = log_; log = log_;
render = new RenderProcess(); render = new RenderProcess();
directoryRemoved = false;
} }
public void block() { public void block() {
@@ -371,6 +376,11 @@ public class Job {
} }
return error; return error;
} }
if (directoryRemoved == false && (process.getMemoryUsed() > 0 || process.getRemainingDuration() > 0)) {
client.removeSceneDirectory(this);
directoryRemoved = true;
}
} }
input.close(); input.close();
} }

View File

@@ -464,6 +464,7 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
Job a_job = new Job( Job a_job = new Job(
this.user_config, this.user_config,
this.client,
this.client.getGui(), this.client.getGui(),
this.client.getLog(), this.client.getLog(),
job_node.getAttribute("id"), job_node.getAttribute("id"),