Merge branch 'simplfy_for_loop' into 'master'
Fix and simplify confirmJob loop See merge request sheepitrenderfarm/client!132
This commit is contained in:
@@ -1035,12 +1035,22 @@ import okhttp3.HttpUrl;
|
|||||||
this.log.debug(checkpoint, "path frame " + ajob.getOutputImagePath());
|
this.log.debug(checkpoint, "path frame " + ajob.getOutputImagePath());
|
||||||
|
|
||||||
this.isValidatingJob = true;
|
this.isValidatingJob = true;
|
||||||
int nb_try = 1;
|
|
||||||
int max_try = 3;
|
int max_try = 3;
|
||||||
ServerCode ret = ServerCode.UNKNOWN;
|
ServerCode ret = ServerCode.UNKNOWN;
|
||||||
Type confirmJobReturnCode = Error.Type.OK;
|
Type confirmJobReturnCode = Error.Type.OK;
|
||||||
retryLoop:
|
retryLoop:
|
||||||
while (nb_try < max_try && ret != ServerCode.OK) {
|
for (int nb_try = 0; nb_try < max_try; nb_try++) {
|
||||||
|
if (nb_try >= 1) {
|
||||||
|
// sleep before retrying
|
||||||
|
this.log.debug(checkpoint, "Sleep for 32s before trying to re-upload the frame");
|
||||||
|
try {
|
||||||
|
Thread.sleep(32000);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e) {
|
||||||
|
confirmJobReturnCode = Error.Type.UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = this.server.HTTPSendFile(url_real, ajob.getOutputImagePath(), checkpoint, this.gui);
|
ret = this.server.HTTPSendFile(url_real, ajob.getOutputImagePath(), checkpoint, this.gui);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case OK:
|
case OK:
|
||||||
@@ -1070,17 +1080,6 @@ import okhttp3.HttpUrl;
|
|||||||
// do nothing, try to do a request on the next loop
|
// do nothing, try to do a request on the next loop
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nb_try++;
|
|
||||||
if (ret != ServerCode.OK && nb_try < max_try) {
|
|
||||||
try {
|
|
||||||
this.log.debug(checkpoint, "Sleep for 32s before trying to re-upload the frame");
|
|
||||||
Thread.sleep(32000);
|
|
||||||
}
|
|
||||||
catch (InterruptedException e) {
|
|
||||||
confirmJobReturnCode = Error.Type.UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isValidatingJob = false;
|
this.isValidatingJob = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user