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

@@ -628,6 +628,8 @@ public class Client {
return err;
}
removeSceneDirectory(ajob);
return Error.Type.OK;
}
@@ -700,6 +702,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;
String renderer_archive = ajob.getRendererArchivePath();

View File

@@ -70,10 +70,14 @@ public class Job {
private boolean serverBlockJob;
private Gui gui;
private Configuration config;
private Client client;
private Log log;
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_) {
private boolean directoryRemoved;
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();
}

View File

@@ -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"),