Feat: incompatible process

This commit is contained in:
Sheepit Renderfarm
2024-06-08 03:21:33 +00:00
committed by Laurent Clouet
parent b295467ca7
commit 83cd92b903
10 changed files with 163 additions and 7 deletions

View File

@@ -187,14 +187,24 @@ import okhttp3.HttpUrl;
Thread threadSender = new Thread(runnableSender);
threadSender.start();
IncompatibleProcessChecker incompatibleProcessChecker = new IncompatibleProcessChecker(this);
Timer incompatibleProcessCheckerTimer = new Timer();
incompatibleProcessCheckerTimer.schedule(incompatibleProcessChecker, TimeUnit.MINUTES.toMillis(1), TimeUnit.MINUTES.toMillis(1));
incompatibleProcessChecker.run(); // before the first request, check if it should be stopped
do {
while (this.running) {
this.renderingJob = null;
synchronized (this) {
if (this.suspended) {
this.gui.status("Client paused", true);
this.log.debug("Client paused");
if (incompatibleProcessChecker.isSuspendedDueToOtherProcess()) {
this.gui.status("Client paused due to 'incompatible process' feature", true);
}
else {
this.gui.status("Client paused", true);
this.log.debug("Client paused");
}
}
while (this.suspended && !this.shuttingdown) {
wait();
@@ -215,8 +225,14 @@ import okhttp3.HttpUrl;
}
this.sleep(wait);
}
this.gui.status("Requesting Job");
this.renderingJob = this.server.requestJob();
if (incompatibleProcessChecker.isRunningCompatibleProcess() == false) {
this.gui.status("Requesting Job");
this.renderingJob = this.server.requestJob();
}
else {
this.gui.status("Wait until compatible process is stopped");
this.sleep(30 * 1000);
}
}
catch (SheepItExceptionNoRightToRender e) {
this.gui.error("User does not have enough right to render project");