Better handle when server is down
This commit is contained in:
@@ -36,6 +36,7 @@ import com.sheepit.client.exception.FermeException;
|
||||
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
||||
import com.sheepit.client.exception.FermeExceptionNoSession;
|
||||
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
||||
import com.sheepit.client.exception.FermeServerDown;
|
||||
import com.sheepit.client.os.OS;
|
||||
|
||||
public class Client {
|
||||
@@ -205,6 +206,18 @@ public class Client {
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (FermeServerDown e) {
|
||||
int wait = 15;
|
||||
int time_sleep = 1000 * 60 * wait;
|
||||
this.gui.status(String.format("Can not connect to server. Please check your connectivity. Will retry in %s minutes", 15));
|
||||
try {
|
||||
Thread.sleep(time_sleep);
|
||||
}
|
||||
catch (InterruptedException e1) {
|
||||
return -3;
|
||||
}
|
||||
continue; // go back to ask job
|
||||
}
|
||||
catch (FermeException e) {
|
||||
this.gui.error("Client::renderingManagement exception requestJob (1) " + e.getMessage());
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
Reference in New Issue
Block a user