Ref: remove duplicate handle code

This commit is contained in:
Sheepit Renderfarm
2023-12-07 15:29:58 +00:00
parent 33a43ffcf8
commit 8e08b86aa1
6 changed files with 100 additions and 51 deletions

View File

@@ -19,7 +19,9 @@
package com.sheepit.client.exception;
public class SheepItExceptionServerOverloaded extends SheepItException {
import java.util.concurrent.ThreadLocalRandom;
public class SheepItExceptionServerOverloaded extends SheepItExceptionWithRequiredWait {
public SheepItExceptionServerOverloaded() {
super();
}
@@ -27,4 +29,12 @@ public class SheepItExceptionServerOverloaded extends SheepItException {
public SheepItExceptionServerOverloaded(String message_) {
super(message_);
}
public String getHumanText() {
return "The server is overloaded and cannot allocate a job. Will try again at %tR";
}
public int getWaitDuration() {
return 1000 * 60 * ThreadLocalRandom.current().nextInt(10, 30 + 1);
}
}