no message

This commit is contained in:
2023-12-03 17:44:32 +03:00
parent 74df6ffa7d
commit 019977ac92
4 changed files with 23 additions and 10 deletions

View File

@@ -14,11 +14,14 @@ public:
fprintf(ptr, "%s\n", text.getCharArray());
}
~File() {
if (ptr != NULL) {
fclose(ptr);
ptr = NULL;
}
}
Close();
}
void Close(){
if (ptr != NULL) {
fclose(ptr);
ptr = NULL;
}
}
Text* readLines(){
Text* lines = new Text();
int c;

View File

@@ -20,12 +20,13 @@ public:
virtual String getStatePrefix(){
return String("Running");
}
/*
virtual void Finalize(){
this->state = Archivation;
saveState();
printf("Archivation started\n");
Utils::ZipFolder(String("./"),String("archive.zip"));
printf("Archivation ended\n");
}
*/
};

View File

@@ -83,7 +83,8 @@ public:
break;
case Execution:
if (task->getState()==WorkspaceReady){
activeCount++;
activeCount++;
task->start_time=Utils::getAbsoluteTime();
task->Start();
}else if (task->getState()==Running){
activeCount++;

View File

@@ -35,12 +35,14 @@ enum TestType{
#pragma once
class Task {
protected:
long id;
long id;
int maxtime;
int kernels; //получение зависит от типа задачи.
String workspace;
TaskState state;
public:
public:
long start_time;
String printState(){
switch(state){
case Inactive:
@@ -146,7 +148,13 @@ public:
//todo определить по интервалу времени на всякий случай.
}else if (Utils::Exists(workspace+"/INTERRUPT")){
state=AbortedByUser;
}
} else {
long now = Utils::getAbsoluteTime();
long delta = now-start_time;
if (maxtime<delta){
state=AbortedByTimeout;
}
}
}
if (state!=Running){
//-