уничтожение процесса тестирования.

This commit is contained in:
2023-09-30 18:19:31 +03:00
parent 3373d2e704
commit 2a69143550
8 changed files with 52 additions and 24 deletions

View File

@@ -6,7 +6,6 @@ import java.io.File;
import java.util.concurrent.Callable;
public class InterruptThread extends Thread{
//------------
public static final String Eliminated = "Eliminated";
public InterruptThread(int sleep_ms, Callable action){
super(() -> {
File interruptFile = new File(db_project_info.interrupt);
@@ -14,7 +13,7 @@ public class InterruptThread extends Thread{
while (true) {
Thread.sleep(sleep_ms);
if (interruptFile.exists()) {
FileUtils.writeStringToFile(new File(Eliminated + " by INTERRUPT file"), "");
FileUtils.writeStringToFile(new File("ABORTED"), "");
FileUtils.forceDelete(interruptFile);
action.call();
}